Commonly Used Linux Commands

Commonly Used Linux Commands

Commonly Used Linux Commands


File and Directory Management

ls
cd Documents
cd /var/www/html
cd ..
nano app.js
vim index.html
rm file.txt
rm -rf directory
cp file.txt backup/file.txt
cp -r directory new_directory
mv file.txt documents/
mv directory/ new_location/
mkdir new_folder
mkdir -p nested/folder/path
rmdir empty_folder

File Content and Search

cat file.txt
grep "keyword" file.txt
grep -r "function" src/

Permissions and Ownership

chmod +x script.sh
chmod 644 file.txt
chown user:group file.txt

System and Process Management

sudo apt-get update
sudo apt-get install nginx
sudo yum update
ps aux
kill 1234

Networking and File Transfer

wget http://example.com/file.zip
curl -O http://example.com/file.zip
tar -czvf archive.tar.gz directory
tar -xzvf archive.tar.gz
ssh username@hostname
scp file.txt username@remotehost:/path/to/destination

Post a Comment

0 Comments