Lab: Learn Bash Commands
pwd
: Display the current directoryls
: List the files and directoriesecho
: Display a non-terminal messageecho "Hello World" > helloworld.txt
: Direct to the output of the echo in a fileecho "Hello World" >> helloworld.txt
: Concatenates an output to an existing filecat helloworld.txt
: Show the content of filels -l
: Show information about the files and pastes of the current directoryls -la
: Show information about the files and folders of the current directory, including hidden files and foldersman
: Linux help command, Displays a manual about the desired commandwhoami
: Displays the name of the usercd "directory"
: Enter a directorycd ..
: Return to the previous directorymkdir
: Create a directoryrmdir
: Delete empty directoryrm
: Delete filerm -r
: Delete a directory recursivelycp abc.txt xyz.txt
: Copyabc.txt
filemv
: Move or rename a filecp -r
: Copy or directory recursivelyzip -r
: Zip a directoryunzip
: Unzip here zippedtar -cz
: Compact and zip the file in tar.gz formattar -xzf
: Decompresses a tar.gz file and redirects to the output of the file
Common tasks you should be able to do:
- Create a folder/file
- Rename folder/file
- Update a file
- Update file/folder permissions
- Delete a folder/file
- List files in a folder
- Move a folder/file
- Copy a folder/file
- Print folder/file tree
- Print file content
- Print current path