Basic Linux

By | 27/04/2014

file management

removes a full directory:

rm -rf directoy1
rm -rf directory2
rm -rf directory?

find files

find -name FILENAME

disk usage

du /directory -h
du /directory -c | grep total

disk management


Create swap sdaX partition using gparted

sudo mkswap /dev/sdaX
sudo swapon /dev/sdaX

Edit /etc/fstab to include the following line

/dev/sdaX none swap sw 0 0

Swap status

swapon -s

command line

move up or down – shift PageUp / PageDown

repeats the previous command with sudo

sudo !!

software installation


update apt-get sources

apt-get update

install a package

apt-get install package


install a package

dpkg -i package



service –status-all



/dev/random – provides random numbers with good quality, but it can hold the request if there is no enough entropy

/dev/urandom – provides random with lower quality without holding the requests. Requires less entropy



uncompres a tar.gz file

tar -xvf file.tar.gz


System settings

GNOME configuration system


Grub Installation

sudo apt-get update
sudo apt-get install grub2
sudo update-grub2
grub-install -v //verify installation


Mount drives automatically

1) get UUID of the drives

sudo blkid

2) Modify /etc/fstab

sudo gedit /etc/fstab

Add the following line:

[UUID] [MountPoint] [FileSystem] [Options] [Dump] [Pass]
UUID=AAABBBCCC /mnt/drive1 ntfs 0 0 0


Move all files including subfolders to a new folder

find /src/dir -type f -exec mv --backup=numbered -t /dst/dir {} +

Reference -


Edit mode – i
Exit edit more – esc

Delete all lines :1,$d
: - run command
1,$ - from line 1 to eof
d - delete



host file – /etc/hosts


Leave a Reply