Linux is, in simplest terms, is a freely distributed, cross-platform operating system based on Unix
Why let Microsoft give you a window, when Linux can give you a House?
sudo update-grub
To get 2nd output:
chmod u+x file1
chmod g-w file1
chmod a-r file1
To revert back to 1st:
chmod u-x file1
chmod g+w file1
chmod a+r file1
To get 2nd output: chmod 740 file1
To revert back to 1st:
chmod 640 file1
-rw-rw-r-- 1 user group 1 2016-02-19 file1
-rwxr----- 1 user group 1 2016-02-19 file1
| Command | Description |
|---|---|
| pwd | Print current directory |
| mkdir <dir> | Create a new directory |
| cd <dir> | Change directory |
| cd .. | Go up a directory |
| cd - | Toggle between last 2 directories |
| ls | List files in current directory |
| Command | Description |
|---|---|
| -a | Show all including hidden |
| -R | Recursive list |
| -r | Reverse order |
| -t | Sort by last modified |
| -S | Sort by file size |
| -l | Long listing format |
| -h | Human readable format |
| -1 | One file per line |
| -m | Comma-seperated output |
| -Q | Quoted output |
| Command | Description |
|---|---|
| rm <file> |
Delete file |
| rm -r <dir> |
Delete directory |
| rm -f <file> |
Force delete file |
| mv <file1> <file2> |
Rename or move file |
| cp <file1> <file2> |
Copy file 1 to file 2 |
| touch <file> |
Create or update file |
| cat file1 > logfile |
Standard |
| cat > <file> | Find all empty files in home directory |
| Command | Description |
|---|---|
| grep <string> <file> | Search for a given string in a file, with the following options: |
| -i | Case insensitive |
| -r | Recursive search |
| -v | Inverted search |
| -o | Show matched part of file only |
| find -iname "MyFile.c" | Find files in directory matching file name (case insensitive) |
| find -iname "MyFile.c" -exec md5sum {} \; | Execute commands on files found by the find command |
| find ~ -empty | Find all empty files in home directory |
| Command | Description |
|---|---|
| tar cvf file.tar directory/ | Create a new tar archive |
| tar xvf file.tar | Extract from a tar archive |
| gzip test.txt | Create a *.gz compressed file |
| gzip -d test.txt.gz | Extract from a *.gz file |
| unzip test.zip | Extract a *.zip compressed file |
owner: read, write & execute