This Is Your Brain On Informatics: Linux Commands: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 52: | Line 52: | ||
| ln | | ln | ||
| ln ''options'' ''source'' ''destination'' | | ln ''options'' ''source'' ''destination'' | ||
| Link: creates a shortcut | | Link: creates a shortcut. Use -s for the ''options'' to create a soft link (more capabilities) | ||
|- | |- | ||
| ls | | ls | ||
| Line 58: | Line 58: | ||
| Lists the files and directories in a given directory | | Lists the files and directories in a given directory | ||
|- | |- | ||
| | | man | ||
| man ''command'' | |||
| Opens the manual page for the given command | |||
|- | |||
| mkdir | |||
| mkdir ''options'' ''filename'' | |||
| Makes a directory at the given location with the given name | |||
|- | |||
| mv | |||
| mv ''options'' ''source'' ''destination'' | |||
| Moves a file or directory from the source to the destination | |||
|- | |||
| pwd | |||
| pwd | |||
| Displays the pathname for the current directory | |||
|- | |||
| rm | |||
| rm ''options'' ''filename'' | |||
| Removes the given file. If -rf is used for the options, a directory and its roots will be removed as well | |||
|- | |||
| ssh | |||
| ssh ''options'' ''user@machine'' | |||
| Remotely logs into the given machine with the given user name | |||
|- | |||
| sudo | |||
| sudo ''command'' | |||
| Allows super user privileges for the given command (requires root password). sudo su allows login to root | |||
|- | |||
| tar | |||
| tar -xzvf | |||
| Extracts files with the extension *.tar.gz or *.tgz | |||
|- | |||
| touch | |||
| touch ''filename'' | |||
| Creates an empty file with given name | |||
|- | |||
|} | |} | ||
Revision as of 07:51, 1 December 2013
General Linux Command Info
- Almost every single command should have an argument (an input for a function)
- A filename in Linux refers to both a file's name and a directory's name
Common Linux Commands
| Command | Syntax | Description |
|---|---|---|
| cat | cat filename | Display file’s contents to the standard output device (usually your monitor) |
| cd | cd /pathname | Change to the given directory |
| chmod* | chmod options mode filename | Changes a file's permissions. |
| chown* | chown private_owner:group_owner filename | Changes ownership of the file |
| clear | clear | Clears the screen by scrolling (does not delete anything) |
| cp | cp options source destination | Copies a file from the source to the destination |
| find | find /pathname string | Starts at the indicated directory and searches for the string in a filename |
| grep | grep options pattern filename | Searches for the pattern in the file |
| ll | ll /pathname | List Long: lists the details of the entire directory or file indicated |
| ln | ln options source destination | Link: creates a shortcut. Use -s for the options to create a soft link (more capabilities) |
| ls | ls /pathname | Lists the files and directories in a given directory |
| man | man command | Opens the manual page for the given command |
| mkdir | mkdir options filename | Makes a directory at the given location with the given name |
| mv | mv options source destination | Moves a file or directory from the source to the destination |
| pwd | pwd | Displays the pathname for the current directory |
| rm | rm options filename | Removes the given file. If -rf is used for the options, a directory and its roots will be removed as well |
| ssh | ssh options user@machine | Remotely logs into the given machine with the given user name |
| sudo | sudo command | Allows super user privileges for the given command (requires root password). sudo su allows login to root |
| tar | tar -xzvf | Extracts files with the extension *.tar.gz or *.tgz |
| touch | touch filename | Creates an empty file with given name |