Difference between revisions of "User:Cyrusty/Useful Commands"

From Organic Design wiki
(Commands for VPS)
m (Useful Commands and Info)
Line 2: Line 2:
  
 
<source lang="bash">
 
<source lang="bash">
ls-al #lists all in current directory
+
ls-al # lists all in current directory
 
</source>
 
</source>
  
Line 10: Line 10:
  
 
<source lang="bash">
 
<source lang="bash">
chmod +x FILENAME #sets all permissions
+
chmod +x FILENAME # sets all permissions
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
mv /FILE/NAME /NEW/LOCATION #moves files
+
mv /FILE/NAME /NEW/LOCATION # moves files
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
mv /FILE/NAME NEWFILENAMEHERE #renames the file
+
mv /FILE/NAME NEWFILENAMEHERE # renames the file
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
pwd #prints working directory
+
pwd # prints working directory
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
top #shows all running processes
+
top # shows all running processes
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
kill xxxx #choose the process number to kill the running application
+
kill xxxx # choose the process number to kill the running application
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
tar xzvf FILENAME #extracts zip files
+
tar xzvf FILENAME # extracts zip files
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
crontab -e #access boot services
+
crontab -e # access boot services
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
@reboot<TAB> /DESTINATION/OF/FILE/FILENAME #Run a program when rebooting
+
@reboot<TAB> /DESTINATION/OF/FILE/FILENAME # Run a program when rebooting
 
</source>
 
</source>
  
  
 
<source lang="bash">
 
<source lang="bash">
ifconfig #shows internet config
+
ifconfig # shows internet config
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
whoami #shows current user
+
whoami # shows current user
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
ps #shows running processes
+
ps # shows running processes
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
sudo nano etc/default/grub #grub info
+
sudo nano etc/default/grub # grub info
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
sudo update-grub #update after making edits to grub
+
sudo update-grub # update after making edits to grub
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
alias NAME="SOMECOMMAND HERE" #creates and alias for a command
+
alias NAME="SOMECOMMAND HERE" # creates and alias for a command
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
chown -R USER:USER FILE/NAME #change all permission
+
chown -R USER:USER FILE/NAME # change all permission
 
</source>
 
</source>
  
 
<source lang="bash">
 
<source lang="bash">
ln -s /PATH/TO/SOMETHING/REAL /usr/local/bin/NAME #makes a file you choose to run by typing an alias
+
ln -s /PATH/TO/SOMETHING/REAL /usr/local/bin/NAME # makes a file you choose to run by typing an alias
 
</source>
 
</source>
  

Revision as of 08:41, 28 April 2018

Useful Commands and Info

ls-al # lists all in current directory
rm -rf FILENAMEHERE # deletes files or directories
chmod +x FILENAME # sets all permissions
mv /FILE/NAME /NEW/LOCATION # moves files
mv /FILE/NAME NEWFILENAMEHERE # renames the file
pwd # prints working directory
top # shows all running processes
kill xxxx # choose the process number to kill the running application
tar xzvf FILENAME # extracts zip files
crontab -e # access boot services
@reboot<TAB> /DESTINATION/OF/FILE/FILENAME # Run a program when rebooting


ifconfig # shows internet config
whoami # shows current user
ps # shows running processes
sudo nano etc/default/grub # grub info
sudo update-grub # update after making edits to grub
alias NAME="SOMECOMMAND HERE" # creates and alias for a command
chown -R USER:USER FILE/NAME # change all permission
ln -s /PATH/TO/SOMETHING/REAL /usr/local/bin/NAME # makes a file you choose to run by typing an alias

Commands for VPS

scp /home/USER root@MY-VPS-IP:home/USER # sends files from localmachine to VPS
scp root@VPSIP:/INSERT_FILE_DIRECTORY_HERE /home/USER/WHEREVER # sends files VPS to PC (to do a whole folder) put -r eg.. scp -r /home/USER/FOLDER root@MY-VPS-UP:/home/USER


cat ~/.bash_history | grep apt-get # Show all the stuff I've tried to install or remove


ssh -NR 1234:localhost:22 cy.rusty.space # Make an SSH connection to my machine temporarily available on port 1234 in the server:

When you're not sure what the syntax is type apropos KEYWORD #helps find the correct syntax user is looking for

If a file in the shell has spacebars used instead of _ or - I need to use a backward \ if I'm trying to do anything with it.