User:Cyrusty/Useful Commands
From Organic Design wiki
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.