Category: Linux

How to get the process name using the pid or process id in linux 0

How to get the process name using the pid or process id in linux

If you already have the PID of a process, running the following command will get you the process name ls -l /proc/PID/exe

How to get the ip address of your local system on linux or Ubuntu 0

How to get the ip address of your local system on linux or Ubuntu

Getting the ip address is pretty simple. hostname -i To know the hostname, just drop the -i hostname While at it, to know what user you are signed in as, just type whoami

How to install fonts on Ubuntu 0

How to install fonts on Ubuntu

This is easier than you think. Simply create a .fonts folder(Notice the dot in the folder name i.e. its a hidden folder) in your home directory and extract your fonts into it. A nice place...

Redirect linux command output to a file as well as to the terminal 0

Redirect linux command output to a file as well as to the terminal

Simply pipe the output of your command to the tee command. See examples below. ls | tee filename The tee command overwrites the output file. To append, use $ ls | tee –a file...

How to open sublime text from the terminal in Ubuntu 0

How to open sublime text from the terminal in Ubuntu

If you dont really want to open sublime text from Unity(which is the desktop manager for Ubuntu), just use this command and save yourself some mouse movements. subl &

How to check your disk space in Ubuntu 0

How to check your disk space in Ubuntu

Ubuntu comes with a nice little command that lets you list your directories and shows the amount of space on them. df -h If you are looking for something more visual, run the following...

How to create a soft link in linux 0

How to create a soft link in linux

A soft link is filename that is just a ‘reference’ to another file or directory. Here’s how you’d create one. ln -s path/to path/from

Toggle back and forth between two directories from the command line 0

Toggle back and forth between two directories from the command line

If you need to continuously switch between two different directories from the command line or in a shell script, this is a super handy command to do just that. cd –

Create n levels of directories with a single command from the terminal 0

Create n levels of directories with a single command from the terminal

On your terminal, use this command to create any number of nested directories in a single command. mkdir -p dir1/dir2/dir3/dir4/dir5