Difference between revisions of "Introduction to Linux"
Jump to navigation
Jump to search
Line 15: | Line 15: | ||
|- | |- | ||
|'''cat''' | |'''cat''' | ||
− | | | + | |Concatenate files, and print to stdout. |
|cat [-options] <path/file> | |cat [-options] <path/file> | ||
|cat readme.txt | |cat readme.txt | ||
|- | |- | ||
|'''cp''' | |'''cp''' | ||
− | | | + | |Copy files or directories. |
|cp [-options] <source> <destination> | |cp [-options] <source> <destination> | ||
|cp -R olddirectory newdirectory | |cp -R olddirectory newdirectory | ||
|- | |- | ||
|'''echo''' | |'''echo''' | ||
− | | | + | |Print text to stdout. |
|echo [-options] <string> | |echo [-options] <string> | ||
|echo -e This my first line \n This is my second line | |echo -e This my first line \n This is my second line | ||
|- | |- | ||
|'''ls''' | |'''ls''' | ||
− | | | + | |List directory contents. |
|ls [-options] <path/file> | |ls [-options] <path/file> | ||
|ls -alh /var/log | |ls -alh /var/log | ||
|- | |- | ||
|'''mkdir''' | |'''mkdir''' | ||
− | | | + | |Make a directory. |
− | | | + | |mkdir [-options] <path/directory> |
− | | | + | |mkdir -p /my/directory/path |
|- | |- | ||
|'''mv''' | |'''mv''' | ||
− | | | + | |Move or rename a file. |
− | | | + | |mv [-options] <source> <destination> |
− | | | + | |mv /from/here/file1.txt /to/here/file1.txt |
|- | |- | ||
|'''pwd''' | |'''pwd''' | ||
− | | | + | |Print the current working directory. |
− | | | + | |pwd [-options] |
− | | | + | |pwd -P |
|- | |- | ||
|'''touch''' | |'''touch''' | ||
− | | | + | |Change file timestamp or create blank file. |
− | | | + | |touch [-options] <path/file> |
− | | | + | |touch -c update.txt |
|} | |} | ||
<br /> | <br /> |
Revision as of 16:39, 8 June 2020
Basic Commands
These are the most basic commands that you should know as a Linux System Administrator.
Command Syntax
Commands that utilize the Bash shell follow this common syntax.
command [-options] [arguments]
Commands
Name | Description | Syntax | Example |
---|---|---|---|
cat | Concatenate files, and print to stdout. | cat [-options] <path/file> | cat readme.txt |
cp | Copy files or directories. | cp [-options] <source> <destination> | cp -R olddirectory newdirectory |
echo | Print text to stdout. | echo [-options] <string> | echo -e This my first line \n This is my second line |
ls | List directory contents. | ls [-options] <path/file> | ls -alh /var/log |
mkdir | Make a directory. | mkdir [-options] <path/directory> | mkdir -p /my/directory/path |
mv | Move or rename a file. | mv [-options] <source> <destination> | mv /from/here/file1.txt /to/here/file1.txt |
pwd | Print the current working directory. | pwd [-options] | pwd -P |
touch | Change file timestamp or create blank file. | touch [-options] <path/file> | touch -c update.txt |