Linux Classroom notes 23/July/2026

file commands:

  1. PWD – print current working directory

pwd

  1. ls – list all files and directory
ls - current location files

ls -a list all files & hideen files 
ls -l show files details with long format 
ls -h human readable 
ls -R list all subdirectory also

  1. Change directory:
cd - path of the location
cd /path/location

# come one step back from current directory
cd ../

# multiple steps back 
cd ../../
  1. touch – create files
touch file1.txt - create file 

touch file2.txt file3.txt file4.txt - create multiple files at once

touch foldername/filename - specific location need create file

  1. mkdir – create folders
mkdir hellowd # single directory 

mkdir demo demo2 demo3 

mkdir demo/data demo2/db demo3/ai

mkdir -p demo4/development 

mkdir -p demo5/development  demo6/qa demo7/test
  1. cat – print containt in the file
cat file path
  1. head – Print the first 10 lines of each FILE to standard output.
head file path

head -n 2 file names
head --lines 
  1. tail – Print the last 10 lines of each FILE to standard output
tail file path

tail -n 2 file names
tail --lines
  1. grep – grep, egrep, fgrep, rgrep – print lines that match patterns
cat filename | grep string

cat hello.txt | grep demo

  1. copy files
cp source desc
cp demo/data/demo.txt  demo5/development/demo1.txt
cp demo/data/demo.txt  demo5/development/demo2.txt
cp -r dem* data/
  1. move/rename folder and files
mv source desc

mv dem* /data/ 

Leave a comment

Turn on JavaScript to leave a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%