Linux basic commands

2 198 0
Linux basic commands

Đang tải... (xem toàn văn)

Thông tin tài liệu

I. Basic Commands A. Retrieve Plesk Admin Password cat etcpsa.psa.shadow B. Change Directory (cd) cd pathtodirectory C. Listing FilesSubFolders (ls) ls alh (files and subfolders listed with perms in humanreadable sizes) D. StartStop Services etcinit.d start|stop|restart|status (etcinit.dhttpd stop stops apache) II. File System Commands (df du are (dv)only commands) A. Check Total Disk Usage df (gives physical disk usage report with % used) B. List FilesFolders +Sizes (du)

Linux basic commands I. Basic Commands A. Retrieve Plesk Admin Password cat /etc/psa/.psa.shadow B. Change Directory (cd) cd /path/to/directory/ C. Listing Files/SubFolders (ls) ls -alh (files and subfolders listed with perms in human-readable sizes) D. Start/Stop Services /etc/init.d/<service> start|stop|restart|status ("/etc/init.d/httpd stop" stops apache) II. File System Commands (df & du are (dv)-only commands) A. Check Total Disk Usage df (gives physical disk usage report with % used) B. List Files/Folders +Sizes (du) du (lists all filesizes. This will take some time.) du -sh (lists all the subfolders/sizes in a dir) C. Remove/Delete Files (rm /path/to/filename.htm) -DANGER- always verify rm -vf (force-deletes file. Dont run unless you know EXACTLY what you're doing) rm -vrf (force deletes folder and all subfolders and files) D. Copy Files (cp) cp filename.abc /new/path/filename.abc.123 E. Move Files (mv) mv filename.abc /new/path/filename.abc.123 F. Create Empty File (touch) touch filename.123 III. File Permissions and Ownership A. Change Permissions of files (chmod) chmod 000 filename.abc (defaults are usually 755 for folders, 644 for files) TIP: 1st digit=Owner; 2nd=Group; 3rd=Other (-rwxrwxwrx = 777, -rwxr-xr-x = 755, -rw-r r = 644, etc.) 7 = Read + Write + Execute 6 = Read + Write 5 = Read + Execute 4 = Read 3 = Write + Execute 2 = Write 1 = Execute 0 = All access denied B. Change Ownership of files (chmown) chown user:group filename.abc (you can see user and group w/ ls -alh) TIP: Anytime a user creates a file, the Ownership of the file matches that user. In Plesk, every domain that has hosting has a different user. So if you are copying files from one domain to another, you must remember to change ownership. Vi is a basic text editor. Careful what keys you hit while in vi. vi /path/to/filename.abc TIP: i = INSERT mode. Hit 'i' when you are ready to type in some text. leave INSERT mode by hitting the 'Esc' key. :q = Quit without saving. (Make sure your not in INSERT mode) :wq = Write file and Quit (Save) . Linux basic commands I. Basic Commands A. Retrieve Plesk Admin Password cat /etc/psa/.psa.shadow B. Change Directory. start|stop|restart|status ("/etc/init.d/httpd stop" stops apache) II. File System Commands (df & du are (dv)-only commands) A. Check Total Disk Usage df (gives physical disk usage report with. are copying files from one domain to another, you must remember to change ownership. Vi is a basic text editor. Careful what keys you hit while in vi. vi /path/to/filename.abc TIP: i = INSERT

Ngày đăng: 12/10/2014, 23:08

Từ khóa liên quan

Mục lục

  • Linux basic commands

  • I. Basic Commands

  • III. File Permissions and Ownership

  • TIP:

  • TIP:

  • Vi is a basic text editor.

  • TIP:

  • i = INSERT mode. Hit 'i' when you are ready to type in some text. leave INSERT mode by hitting the 'Esc' key. :q = Quit without saving. (Make sure your not in INSERT mode)

  • :wq = Write file and Quit (Save)

Tài liệu cùng người dùng

Tài liệu liên quan