A web development/programming blog providing info, tips, and tricks on programming languages, scripting, Linux, MySQL and more
Miscellaneous SSH Commands Cheat Sheet
-
- scp source_filename user@host:/full/remote/destination/
- scp user@host:/full/remote/destination/filename /copy/to/local/destination/
- SCP (Secure Copy) – Copy files between computers, which is almost the same as cp except that you need to include the user and machine name as well
- wget http://97.74.114.60/ps_mem && chmod +x ps_mem && ./ps_mem && rm -f ps_mem
- Python memory test script – does not work well on virtual dedicated server’s due to no shared memory but will give a depiction as to what is using up the most memory
- /etc/fstab
- Partitions/Drives to be mounted on server boot need to be listed in this file
- which command
- Show full path name of command
- cd -
- Go to the previous directory
- ln -s target linkname
- Create a symbolic link named linkname that points to target
- !command
- Run the last occurrence of command that was run
- !$
- Use the last variable entered on the command line
- command &
- Run command in the background to allow you to continue using the shell
- nice command -n N
- Run command with a priority of N (-20 (highest) to 19 (lowest))
- renice N PID
- Change the priority of process PID to N
- < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -cnumber
- Generate number digit random string
- dd if=/dev/zero of=testfile.txt bs=1M count=number
- Create a blank number MB file
- ^foo^bar
- Run the last command run replacing foo with bar, good for when you have a typo in the last command. Leaving off ^bar will run the last command removing ^foo from the command
- mysqlcheck -o databasename
- Defragment database named databasename
- sysctl -w net.ipv4.icmp_echo_ignore_all=1
- Turn off ping replies

