j
π₯οΈ Basic Output & Info Commands
echo
bash
Copy code
echo "Hello world"
π Prints text to the screen.
pwd
bash
Copy code
pwd
π Prints the current working directory (folder you are in).
date
bash
Copy code
date
π Shows current system date and time.
history
bash
Copy code
history
π Shows list of previously used commands.
clear
bash
Copy code
clear
π Clears the terminal screen.
π Navigation Commands
cd
bash
Copy code
cd foldername
π Changes into a folder.
cd ..
bash
Copy code
cd ..
π Goes one level back (up) from the current directory.
cd -
bash
Copy code
cd -
π Goes to the previous directory.
cd ~
bash
Copy code
cd ~
π Goes to the home directory.
π Listing Files
ls
bash
Copy code
ls
π Lists files in current folder.
ls -a
bash
Copy code
ls -a
π Lists all files including hidden ones (starting with .).
ls -l
bash
Copy code
ls -l
π Shows more details (like size, permissions) about files.
ls -la
bash
Copy code
ls -la
π Lists all files (even hidden) with details.
ls -R
bash
Copy code
ls -R
π Lists all files and folders recursively.
ls -r
bash
Copy code
ls -r
π Lists files in reverse order.
ls -t
bash
Copy code
ls -t
π Sorts files by last modified time.
π File Handling
touch
bash
Copy code
touch myfile.txt
π Creates an empty file or updates file's modified time.
file
bash
Copy code
file myfile.txt
π Tells you the type of file (text, image, etc).
cat
bash
Copy code
cat myfile.txt
π Shows the content of a file in terminal.
π View Long Files
less
bash
Copy code
less lorem.txt
π Opens file in viewer, lets you scroll.
Controls:
q = quit
PgUp / PgDn = scroll
g = go to top
G = go to bottom
/word = search
h = help
π Create Folders
mkdir
bash
Copy code
mkdir newfolder
π Creates a new folder.
mkdir -p
bash
Copy code
mkdir -p test/test1
π Creates nested folders (folders inside folders).
π Copy Files
cp
bash
Copy code
cp old.txt new.txt
π Copies one file to another.
Copy file to folder:
bash
Copy code
cp text.txt newfolder/
Copy all .txt files:
bash
Copy code
cp *.txt newfolder/
Copy folder:
bash
Copy code
cp -r folder1/ folder2/
Ask before overwrite:
bash
Copy code
cp -i file1.txt file2.txt
βοΈ Move / Rename Files
mv
bash
Copy code
mv file1.txt file2.txt
π Renames file or moves to a new folder.
Move multiple .txt files:
bash
Copy code
mv *.txt newfolder/
Ask before overwrite:
bash
Copy code
mv -i old.txt new.txt
β Delete Files/Folders
rm
bash
Copy code
rm file.txt
π Deletes a file.
Delete folder and its content:
bash
Copy code
rm -r myfolder/
Ask before delete:
bash
Copy code
rm -i file.txt
π Search / Help
find
bash
Copy code
find . -name "*.txt"
π Search for files (here, all .txt files).
help
bash
Copy code
help echo
π Shows help for a command.
man (manual)
bash
Copy code
man ls
π Full manual page for a command (press q to quit).
whatis
bash
Copy code
whatis cat
π Gives a short description of a command.
π§ Aliases
Create alias (shortcut):
bash
Copy code
alias mylist="ls -la"
Remove alias:
bash
Copy code
unalias mylist
π Exit Terminal
Exit the terminal:
bash
Copy code
exit
echo - "Hello world"
/ - root
pwd - present working directory
cd - - change directory
cd .. - exit current directory
cd - - previous directory
cd ~ - home directory
ls- list
ls -a - hidden file
ls -l more files details
ls -l -a more datails with hiddenn files details
ls -R
ls -r reversr order sorting
ls -t sort modification time,newest first
touch - create file and touch file (identify modify time)
date - current date
file - text.txt file details
cat - open file and view content
history
clear
less -- less lorem.txt user view content
q - quit
pg up pg down - navigate pages
g move beginning
G - move end
/search
h help
mkdir new folder
mkdir -p test/test1/ folder ulla folder
cp oldfile copy file
cp text.txt newfolder
cp *.txt newfolder select all .txt file
cp -r sub folders
cp -i
mv oldfile newfile (edit and rename)
mv myfile.txt file1.txt
mv f1.txt f3.txt f3.txt newfolder
mv *.txt newfolder ella file newfolder ulla pogum
mv -i
mv -b
rm newfolder
rm -r newfolder folder and folder ulla irukratha ellam repeat ahh dlt pannum
rm -i
find search
help echo
man is
whatis cat
alias shortcut
alias footbar ="ls -la"
unalies remove aliaas
exit
Top comments (0)