Manage files and folders
- cd - change directory
- ls - list the content of a directory
- pwd - parent working dir
- mkdir - create a new directory
- rm - Remove files and folders
- cp - Copy files and folders
- mv - Move files and folders
- ditto - Move files and folders (advanced)
Acess and permission to files/folders
ls
Syntax: ls [-Options] <search pattern>
Usage/Result: List the content of the current working directory.
Options:
| -A | Lists all files except . and .. |
| -a | Include hidden files like files that begins with a dot (.) |
| -f | The list of files will not be sorted |
| -l | Detailed list view: filesize, ownership, date/time etc. |
| -h | Use readable filesizes like kb/mb/gb instead of just byte size |
| -R | Recursive - will also list the content of eventual subtrees. |
| -r | Sort files in reversed order |
| -S | Sort files by filesize |
| -t | Sort files by when they were last modified |
| -u | Sort files by when they were last accessed |
Exempel
| ls | Lists all the files in the current working dir. |
| ls a* | Lists all the files that begins with the letter "a" (* is used as a wildcard) |
| ls *.zip | List every file that ends with *.zip |
| ls -lShr | Detailed list (-l) of the current working dir. -S = Sort by filesize -h = Use readable filesizes(kb/mb/gb). -r = Sort files in reversed order |
Advanced examples
| Usage/Result | |
|---|---|
| ls | more | List files one page at a time. Use "Space" to view the next set of files. |