Getting Started with Basic Linux (Bash) Commands Part -1
1. Navigating the File System
pwd
: Print Working DirectoryDisplays the current directory you are in.
Example:
pwd
ls
: List Directory ContentsLists files and directories in the current directory.
Example:
ls
cd
: Change DirectoryUsed to navigate between directories.
Example:
cd /path/to/directory
2. File and Directory Management
mkdir
: Make DirectoryCreates a new directory.
Example:
mkdir new_directory
touch
: Create an Empty FileCreates a new empty file or updates the timestamp of an existing file.
Example:
touch newfile.txt
cp
: Copy Files and DirectoriesCopies files or directories from one location to another.
Example:
cp source.txt destination.txt
mv
: Move or Rename Files and DirectoriesMoves files or directories or renames them.
Example:
mv oldname.txt newname.txt
rm
: Remove Files or DirectoriesDeletes files or directories (use with caution!).
Example:
rm file.txt
3. Viewing and Editing Files
cat
: Concatenate and Display FilesDisplays the contents of a file in the terminal.
Example:
cat file.txt
nano
: Simple Text EditorOpens a file in the Nano text editor for editing.
Example:
nano file.txt
less
: View File Contents
Allows you to view the contents of a file one screen at a time.
Example:
less file.txt
More to come in future blogs stay updated ...