marp | paginate | color | backgroundColor | header | footer | author |
---|---|---|---|---|---|---|
true |
true |
![width:100px height:100px](./img/logo.png) |
**20/10/2021 - AnthonyF** |
AnthonyF |
- Navigation in a shell
- Files and directories
- Writing and displaying
FHS is a directory structure used by every Linux distros. More info
List directory contents.
GNU coreutils, (1) General commands
Arguments | Description |
---|---|
-l |
More information in list format. |
-a |
Hidden files. |
-R |
Recursive, list files in sub-directories. |
-lSh |
Sort by size with human readable. |
-i |
Inodes. |
-n |
Numeric UID and GID. |
Change the working directory.
Built in shell command, no proper man
type cd
help cd
man builtins
Commands | Description |
---|---|
cd .. |
Go to parrent directory. |
cd - |
Go back to the previous working directory |
cd or cd ~ |
Go the home directory. |
Print name of current working directory.
GNU coreutils, (1) General commands
Create/make directories.
Usage : mkdir directory
GNU coreutiles, (1) General commands
Options | Description |
---|---|
-p |
Create parents directories if don't exist. |
Remove files or directories.
GNU coreutils, (1) General commands
Options | Description |
---|---|
-i |
Alert before every removal. |
-d |
Remove only empty directory. |
-r |
Remove directories and their contents recursively. |
Copy files and directories.
Usage : cp source destination
GNU coreutils, (1) General commands
Options | Description |
---|---|
-d |
No deference, preserve links. |
-r |
Copy recursively. |
-a |
Same as -dr . |
Move or rename files and directories.
GNU coreutils, (1) General commands
Change file timestamps. Can also create an empty file.
GNU coreutils, (1) General commands
Concatenate files and print on the standard output. Can also create and write in files.
GNU coreutils, (1) General commands
cat file
cat > file
Stop writing with Ctrl + c
cat >> file
cat > file << EOF
Output the first part of files.
GNU coreutils, (1) General commands
Options | Description |
---|---|
-n NUM |
Print the first NUM lines. |
-n -NUM |
Print all but not the last NUM lines. |
Output the last part of files.
GNU coreutils, (1) General commands
Options | Description |
---|---|
-n NUM |
Print the last NUM lines. |
-n +NUM |
Print starting at line NUM. |
-f |
Output appended data as the file grows. |