Recent Posts
- (09/10) Fixing Warning: the ECDSA host key for 'github.com' differs from the key for the IP addressTAGS:Web Server Admin
- (12/26) CakePHP 3 - Getting List of Column Definitions from a Table (like schema())TAGS:CakephpCake3
- (09/14) Change Order of Loaded Behaviors in CakePHP 3TAGS:Cake3CakephpWeb ProgrammingPhp
- (05/29) CakePHP 3 - Accept JSON Header Only Working When Debug FalseTAGS:Web ProgrammingCakephpCake3
- (05/23) Remove All Events from Google Calendar (Reset Calendar)TAGS:Web ProgrammingPhp
- (11/08) Google Tag Manager (GTM) Not Firing Default PageView EventTAGS:Web ProgrammingJavascriptGoogle Tag Manager
- (10/13) In PHP, how do you get __toString() Magic Method Result without calling echo?TAGS:CakephpCake3Cakephp 13PhpWeb Programming
- (11/14) Getting output from shell_exec() at all timesTAGS:Web ProgrammingWeb Server Admin
Subscribe to my feed
MainelyDesign.com Blog
Common SSH Commands (An Idiot's Guide)
Posted on 09/25/2010 at 09:25 am by Kevin Wentworth
Viewed 13,441 times | 2 comments
Well, I never thought I would be saying this, but I'm starting to love using SSH to manage certain elements of my server. Now that I'm using ssh bash to make some updates to my server, I find myself constantly hunting for the simple commands. I'm going to put all the commands I need below, because I'm the idiot and it's my guide.
Changing Directories / Navigating
cd /dir/to/go/to/
cd .. (up a directory; that's a space, then dot-dot)
cd - (back to last directory, space-hyphen)
dir (list directories in current directory)
Delete/Remove a Directory
rm -r -f <directory> (-r = recursive; -f = without any confirmation prompts)
List File/Folder Attributes
ls -laF (-laF = no clue; that's why I'm making this guide)
Change Ownership
chown -R <user> <directory> (-R = recursive, capital R)
Change Group
chgrp -R <group> <directory> (-R = recursive)
Targeting Current Directory
. = current directory
Change Current User (create shell)
su <username> (will stay in same directory, just switch user)
su - <username> (- = will go to home directory of the user)
exit - to exit the current su/shell
Making a SymLink
ln -s /home/source/dir/ /home/target/sym/link/dir
Removing a Symlink (see)
rm /home/target/sym/link/dir (no trailing slash)
unlink /home/target/sym/link/dir (no trialing slash)
From the above list, you can see how advanced my knowledge of bash is...
Cheers,
-Kevin Wentworth
Tags for Common SSH Commands (An Idiot's Guide)
Web Server Admin | Usage | Example
Comments for this Posting
Sorry, comments are closed for this posting.
Please Email Kevin if you have any questions. Thanks!
Posted by Matt
on 23/10/10
Very basic. You might want to pick up an Oreilly book or two.