This is the repository for the LauzHack Cloud Computing Workshop on 2024-11-21.
Welcome to the Terminal Basics! This guide will help you navigate, manage files, and use essential commands in the terminal.
- Navigation Commands
- File and Directory Management
- Viewing and Editing Files
- Searching Files
- System and Process Information
- Permissions Management
- Useful Tips
pwd
: Print the current directory.$ pwd
ls
: List files and directories.$ ls # Basic list $ ls -a # Include hidden files $ ls -l # Detailed listing
cd
: Change directory.$ cd foldername # Navigate to a folder $ cd .. # Go up one directory $ cd /path/to/folder # Move to a specific folder
touch
: Create an empty file.$ touch filename.txt
mkdir
: Create a new directory.$ mkdir foldername
rm
: Remove files or directories.$ rm filename # Delete a file $ rm -r foldername # Delete a directory
cp
: Copy files or directories.$ cp source.txt destination.txt # Copy a file $ cp -r folder1 folder2 # Copy a directory
mv
: Move or rename files.$ mv oldname.txt newname.txt # Rename a file $ mv file.txt /path/to/folder # Move a file
cat
: Display file contents.$ cat filename.txt
nano
: Edit files using Nano editor.$ nano filename.txt
less
: View large files one page at a time.$ less filename.txt
grep
: Search for specific text in files.$ grep "keyword" filename.txt # Search within a file $ grep -r "keyword" . # Recursive search
whoami
: Display the current user.$ whoami
top
: View running processes in real-time.$ top
df -h
: Check disk space usage.$ df -h
free -h
: Display memory usage.$ free -h
chmod
: Change file permissions.$ chmod 755 filename
chown
: Change file ownership.$ chown user:group filename
-
Auto-complete with Tab: Press
Tab
while typing a command or file name to auto-complete. -
Command History: Use
Up
andDown
arrow keys to access previous commands. -
Clear Terminal:
$ clear
Or press
Ctrl + L
. -
Interrupt Commands: Press
Ctrl + C
to stop a running command. -
Search Command History: Use
Ctrl + R
to search through previous commands.