Unix Command Cheat Sheet

  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Unix Command Cheat Sheet as PDF for free.

More details

  • Words: 750
  • Pages: 3
Tips by TheDocBlog : Webmaster Tips and Resource Blog Read advanced tutorials, guides, and how to articles on all aspects of Adult Web Development.

Unix Command Cheat Sheet

Below is a broken down list of Unix commands you may find useful within most Unix command shells. General help & info: type text within quotes help & help help Basic help listings. man command Example: man whois Brings up the manual for that command. * Press CTRL+C to escape from help, manual menus and other full window options. Basic Commands: who or w Displays who is currently logged on the server & the user information. uptime How long the server has been running. date Shows the current system date. whoami Who you are logged in as, your user. df Displays how much disc space is left on each drive / partition. General Commands: pwd Displays your current directory. cd dirname or cd /full/directory/path/ Changes your directory. cd websites or cd /usr/local/www/domain.com/www/ cd.. Backup a directory (cdup is the same as cd..) cd ../../../ Backup 3 directories. su Brings up password prompt for root user. su username Changes the login to that username. ls and ls -l Typed within a directory for a directory listing. mkdir dirname Creates a directory. mv olddirectory newdirectory Renames a directory or file to a new name. Admin Commands: top What's running, load averages, server status information. rm -r directory Removes a directory permanently. cp filename /path/to/new/location/ or cp filename /directory/ Moves file to a new location. cp directory /path/to/new/location/ Moves that directory into the given path directory. cp directory/ /path/to/new/location/ Movies the files within that

© Tips by TheDocBlog : Webmaster Tips and Resource Blog · URL of this document: http://thedocblog.com/unix-command-cheat-sheet-49.html · Document created: May 27th, 2009, 3:27 pm

TheDoc · Wednesday, January 25th, 2006

directory to within the new location. dig domain.com Displays name server, name servers, and other information about the domain. finger username Displays information about a username and group status ps ax Lists all processes running on the server. kill pid pid=process id. This command terminates the process # or id. netstat Active Connections On The Machine. ln -s /target/path/to/open linkname Creates a short cut / symbolic link to a target directory. Searching For Files & Directories: locate filename.ext or locate filename Searches system for file name. locate filename | more Sorts into pages, use the spacebar to advance. whereis filename Tells the path location to a file. File Editors & File Viewing: vi filename.ext Opens the VI editor. VI Editor Information. pico filename.txt Basic Unix Text Editor. Pico Information. more filename.txt Displays one page of the file at a time. Spacebar for more. User & Group Permissions & Information: id username Displays information about the username groups username Displays what group the username belongs to. passwd

username

Change

the

password

for

a

username.

userdel username Deletes a username from the system. userdel -r username Deletes user and users home directory. chsh username Changes the shell to that user. Tarring & Zipping Files: tar -cvzf mytar.tar.gz directory/ Creates a new tar file of the files within that directory. tar -xvf mytar.tar.gz directory Dumps the contents of the file to given directory. gzip directory Creates a compressed file of that directory. gunzip file.gz Dumps the contents of the file to that file names directory. Basic Chmod / Permission Commands: Sometimes you may need to chmod a file or directory. To do this cd (change directory) to the location of the file or directory you need to modify. chmod ### filename or chmod ### directory Changes the permissions on the file or directory. chmod -r ### directory Changes the permissions on all files within the directory. Most common chmod commands you will use: (chmod with WS_FTP) chmod 777 file/directory Gives read, write and execute access for everyone on a file. Most open type of permission. chmod 755 file/directory

Gives read and execute access for everyone on a file. Gives write access to the owner file / the person who installed the file. chmod 666 file/directory Gives read and write access for everyone on a file. Often log files. Hope This Helps, ~ TheDoc

This entry was posted on Wednesday, January 25th, 2006 at 8:01 pm and is filed under Admin & Servers You can follow any responses to this entry through the Comments (RSS) feed. You can leave a response, or trackback from your own site.

Tips by TheDocBlog : Webmaster Tips and Resource Blog is proudly powered by WordPress. PDF created by ContuttoPDF.

Related Documents

Command Cheat Sheet
June 2020 12
Unix Command
November 2019 26
Unix Command
August 2019 26
Cheat Sheet
August 2019 52