This Is Your Brain On Informatics: Linux Commands: Difference between revisions
No edit summary |
No edit summary |
||
| Line 4: | Line 4: | ||
===Common Linux Commands=== | ===Common Linux Commands=== | ||
{| class="wikitable | {| class="wikitable" | ||
|- | |- | ||
! Command | ! style="padding: 10px;"| Command | ||
! Syntax | ! style="padding: 10px;"| Syntax | ||
! Description | ! style="padding: 10px;"| Description | ||
|- | |- | ||
| cat | | style="padding: 10px;"| cat | ||
| cat ''filename'' | | style="padding: 10px;"| cat ''filename'' | ||
| Display file’s contents to the standard output device (usually your monitor) | | style="padding: 10px;"| Display file’s contents to the standard output device (usually your monitor) | ||
|- | |- | ||
| cd | | style="padding: 10px;"| cd | ||
| cd ''/pathname'' | | style="padding: 10px;"| cd ''/pathname'' | ||
| Change to the given directory | | style="padding: 10px;"| Change to the given directory | ||
|- | |- | ||
| chmod* | | style="padding: 10px;"| chmod* | ||
| chmod ''options'' ''mode'' ''filename'' | | style="padding: 10px;"| chmod ''options'' ''mode'' ''filename'' | ||
| Changes a file's permissions. | | style="padding: 10px;"| Changes a file's permissions. | ||
|- | |- | ||
| chown | | style="padding: 10px;"| chown | ||
| chown ''private_owner:group_owner'' ''filename'' | | style="padding: 10px;"| chown ''private_owner:group_owner'' ''filename'' | ||
| Changes ownership of the file | | style="padding: 10px;"| Changes ownership of the file | ||
|- | |- | ||
| clear | | style="padding: 10px;"| clear | ||
| clear | | style="padding: 10px;"| clear | ||
| Clears the screen by scrolling (does not delete anything) | | style="padding: 10px;"| Clears the screen by scrolling (does not delete anything) | ||
|- | |- | ||
| cp | | style="padding: 10px;"| cp | ||
| cp ''options'' ''source'' ''destination'' | | style="padding: 10px;"| cp ''options'' ''source'' ''destination'' | ||
| Copies a file from the source to the destination | | style="padding: 10px;"| Copies a file from the source to the destination | ||
|- | |- | ||
| find | | style="padding: 10px;"| find | ||
| find ''/pathname'' ''string'' | | style="padding: 10px;"| find ''/pathname'' ''string'' | ||
| Starts at the indicated directory and searches for the string in a filename | | style="padding: 10px;"| Starts at the indicated directory and searches for the string in a filename | ||
|- | |- | ||
| grep | | style="padding: 10px;"| grep | ||
| grep ''options'' ''pattern'' ''filename'' | | style="padding: 10px;"| grep ''options'' ''pattern'' ''filename'' | ||
| Searches for the pattern in the file | | style="padding: 10px;"| Searches for the pattern in the file | ||
|- | |- | ||
| ifconfig | | style="padding: 10px;"| ifconfig | ||
| ifconfig | | style="padding: 10px;"| ifconfig | ||
| Displays the current networks available and various information about them | | style="padding: 10px;"| Displays the current networks available and various information about them | ||
|- | |- | ||
| ll | | style="padding: 10px;"| ll | ||
| ll ''/pathname'' | | style="padding: 10px;"| ll ''/pathname'' | ||
| List Long: lists the details of the entire directory or file indicated | | style="padding: 10px;"| List Long: lists the details of the entire directory or file indicated | ||
|- | |- | ||
| ln | | style="padding: 10px;"| ln | ||
| ln ''options'' ''source'' ''destination'' | | style="padding: 10px;"| ln ''options'' ''source'' ''destination'' | ||
| Link: creates a shortcut. Use -s for the ''options'' to create a soft link (more capabilities) | | style="padding: 10px;"| Link: creates a shortcut. Use -s for the ''options'' to create a soft link (more capabilities) | ||
|- | |- | ||
| ls | | style="padding: 10px;"| ls | ||
| ls ''/pathname'' | | style="padding: 10px;"| ls ''/pathname'' | ||
| Lists the files and directories in a given directory | | style="padding: 10px;"| Lists the files and directories in a given directory | ||
|- | |- | ||
| man | | style="padding: 10px;"| man | ||
| man ''command'' | | style="padding: 10px;"| man ''command'' | ||
| Opens the manual page for the given command | | style="padding: 10px;"| Opens the manual page for the given command | ||
|- | |- | ||
| mkdir | | style="padding: 10px;"| mkdir | ||
| mkdir ''options'' ''filename'' | | style="padding: 10px;"| mkdir ''options'' ''filename'' | ||
| Makes a directory at the given location with the given name | | style="padding: 10px;"| Makes a directory at the given location with the given name | ||
|- | |- | ||
| mv | | style="padding: 10px;"| mv | ||
| mv ''options'' ''source'' ''destination'' | | style="padding: 10px;"| mv ''options'' ''source'' ''destination'' | ||
| Moves a file or directory from the source to the destination | | style="padding: 10px;"| Moves a file or directory from the source to the destination | ||
|- | |- | ||
| [[This Is Your Brain On Informatics: Pico|pico]] | | style="padding: 10px;"| [[This Is Your Brain On Informatics: Pico|pico]] | ||
| pico ''filename'' | | style="padding: 10px;"| pico ''filename'' | ||
| Opens the given file in the pico text editor | | style="padding: 10px;"| Opens the given file in the pico text editor | ||
|- | |- | ||
| pwd | | style="padding: 10px;"| pwd | ||
| pwd | | style="padding: 10px;"| pwd | ||
| Displays the pathname for the current directory | | style="padding: 10px;"| Displays the pathname for the current directory | ||
|- | |- | ||
| rm | | style="padding: 10px;"| rm | ||
| rm ''options'' ''filename'' | | style="padding: 10px;"| rm ''options'' ''filename'' | ||
| Removes the given file. If -rf is used for the options, a directory and its roots will be removed as well | | style="padding: 10px;"| Removes the given file. If -rf is used for the options, a directory and its roots will be removed as well | ||
|- | |- | ||
| ssh | | style="padding: 10px;"| ssh | ||
| ssh ''options'' ''user@machine'' | | style="padding: 10px;"| ssh ''options'' ''user@machine'' | ||
| Remotely logs into the given machine with the given user name | | style="padding: 10px;"| Remotely logs into the given machine with the given user name | ||
|- | |- | ||
| sudo | | style="padding: 10px;"| sudo | ||
| sudo ''command'' | | style="padding: 10px;"| sudo ''command'' | ||
| Allows super user privileges for the given command (requires root password). sudo su allows login to root | | style="padding: 10px;"| Allows super user privileges for the given command (requires root password). sudo su allows login to root | ||
|- | |- | ||
| tar | | style="padding: 10px;"| tar | ||
| tar -xzvf ''filename'' | | style="padding: 10px;"| tar -xzvf ''filename'' | ||
| Extracts files with the extension *.tar.gz or *.tgz | | style="padding: 10px;"| Extracts files with the extension *.tar.gz or *.tgz | ||
|- | |- | ||
| touch | | style="padding: 10px;"| touch | ||
| touch ''filename'' | | style="padding: 10px;"| touch ''filename'' | ||
| Creates an empty file with given name | | style="padding: 10px;"| Creates an empty file with given name | ||
|- | |- | ||
| wget | | style="padding: 10px;"| wget | ||
| wget ''internet address'' | | style="padding: 10px;"| wget ''internet address'' | ||
| Downloads a file from a given internet address | | style="padding: 10px;"| Downloads a file from a given internet address | ||
|- | |- | ||