About this topic
- Tool
- Core commands
- Level
- Basic
- Commands
- 6
- Access
- Free
- Source
- Linux man-pages
Commands
mkdir -p src/components
Creates nested directories in one go.
mkdir- creates directories
-p- also create missing parents, no error if it exists
src/components- path to create
touch notes.txt
Creates an empty file.
touch- creates the file if missing, otherwise updates its modification time
notes.txt- file name
cp -r src backup
Copies a directory together with its contents.
cp- copies
-r- recursive: include subdirectories
src- source
backup- destination
mv draft.txt final.txt
Renames or moves a file.
mv- moves / renames
draft.txt- old name
final.txt- new name
rm -i old.log
Asks for confirmation before deleting.
rm- deletes files (there is no recycle bin)
-i- ask before every removal
old.log- file to delete
ln -s /opt/app/config.yml config.yml
Creates a shortcut (symbolic link) to a file.
ln- creates links
-s- symbolic link
/opt/app/config.yml- the real file
config.yml- name of the link
Start practising
Practise the commands in your browser: learn mode explains every part, exam mode shows only the question.