SSH basics


Published September 19, 2014 at 2:17 PM

pwd = (print working directory) tell me where I am

cd = (change directory)
[cd /etc/httpd/conf.d]
That will move you to the /etc/httpd/conf.d directory. Enter [pwd] to verify it if you want.

ls = (list files in the directory)
+ a = (all files), l = (long format), h = (easy units)
So you could use [ls -a] and it prints out a run on list of the files
[ls - al] prints it out in a clean format

Using [ls - al] file rows will begin with something like -rw-r--r--
rw = (read/write access), r = (read access), x = (executable)
each group of beginning with a - is a permissions set,
First "-rw" is the owner, the owner has read/write permissions
Second "-r-" the group, group has read permissions
Last "-r-" everyone, everyone has read permissions

chmod = (change permission)

Quick permissions guide:

7 = Read + Write + Execute
6 = Read + Write
5 = Read + Execute
4 = Read
3 = Write + Execute
2 = Write
1 = Execute
0 = All access denied

First number is for the owner, second for the group, and third for everyone.

[chmod 755 index.php] will give the owner Read/Write/Execute permission, the group read/execute permissions, and everyone read/execute permissions, on the index.php file

cp = (copy a file)
[cp foo.jpg bar/foo.jpg] this will copy the file foo.jpg into the bar directory

vi = create file if doesn't exist, otherwise edit file if it exist
[vi settings.ini] will open the file settings.ini
press "i" to enable "insert mode" using the arrows to navigate the contents. Make your change and press "Esc" to get out of insert mode.

  • :q! : Forces the editor to exit without saving.
  • :w : Saves the changes that have been made to the file.
  • :wq : Saves the changes that have been made to the file and then exits.
  • :# : Where # is a number - Brings you to line number #
  • :$ : Brings you to the last line of the file
  • :0 : Brings you to the first line of the file
  • :/word : This will search for the string "word" in the file. By pressing "n" you can view the other search result.

side link for me to have stored: exceeds MaxRequestLen (16777216) plesk mod_fcgid unable to upload large files

Tags : alaska,