Linux Help

Updated . Posted . Visible to the public.

How to show line number in vi editor
: Run

:set nu

How to show line number in gedit
: 1)Click on Edit menu
2)Select the Preference

3)Tick the Display line numbers

How to clear the screen

: ctrl + l

How to check the IP

: ifconfig

How to check the running process

: ps aux | grep redis

How to add users

  1. Open the terminal application.
  2. Login to Ubuntu server using ssh.
  3. Add a new user named foo to www-data group by running
 useradd -g www-data foo

command.
4) Add an existing user bar to Apache’s www-data group on Ubuntu using

usermod -a -G www-data bar

command.

5) Check the groups using following command

groups bar

OR

id foo

How to check disk storage

df -h

How to check folder storage

du -sh codepool

check the free memory

free -m

free -g

**Copy the files from one folder to another **

cp -a /source/. /dest/

The dot is used to copy all the files and folders from source folder

**GZ compress and extracting
**

tar -zcvf tar-archive-name.tar.gz source-folder-name
tar -zxvf backup.tar.gz

Extracting tar.xz

tar xf rrrrmages.tar.xz 

Find the distribution version

lsb_release -a

Adding to path

1.add this in ~./bashrc file

if [ -d "new-path" ]; then
  PATH=$PATH:new-path
fi
source ~/.bashrc

Compress file with exclude command

tar -zcvf media.tar.gz --exclude='media/catalog/product/cache/*' media/

Find diff for two folders

diff -qr html/ /home/acer/works/projects/

Adding additional port to listen web request in firewall

ufw allow 81/tcp

How to fix the sound issue in Ubuntu 18.04 after the kernel upgrade

Edit the alsa-base.conf by adding following two entries

sudo gedit /etc/modprobe.d/alsa-base.conf
options snd-hda-intel dmic_detect=0
options snd-hda-intel model=alc256-asus-mic

Checking the current folder has any symlinks

find . -type l -printf '%p -> %l\n'

copy file from remote to local

scp -i <pem.pem> <username>@<ip>:/home/ubuntu/backup/file_backups/appf.tar.gz .

copy the files from one location to another with same root folder that alreay exist in target parth

cp -r app /var/www/html
ln -s /etc/nginx/sites-available/mydomain.com /etc/nginx/sites-enabled/mydomain.com

sudo rm /etc/nginx/sites-enabled/mydomain.com
sudo unlink /etc/nginx/sites-enabled/mydomain.com

Extracting sql.gz file

gzip -d dump-main-1664183353.sql.gz

Install Java download

First download the debian package

sudo dpkg -i /path/package_name.deb

If error

sudo apt-get install -f
vasan
Last edit
vasan
Keywords
line, number
Posted by vasan to vasan's deck (2014-05-22 03:47)