Bishwajit Ghose

     Linux was my stepping stone into the world of big data. I still remember the very first class that made the instructor take about 3 hours to help us INSTALL Hadoop. The program itself was beast difficult, but the result was sweet. It took me weeks to figure how to install all those applications that accompany Hadoop in performing its magics. I have later switched to Spark for various reasons, but still visit the Ubuntu environment from time to time to experience its ultra sleek interface with lightning fast performance. Here are some basic commands that new users will find handy to get started with: 

some fun commands I liked to run before going to the main course: 

Basics

$ whoami

and

finger


Running a command with superuser control

sudo -c “mkdir /etc/test”

 

Making a text file using the cat comand:

 

Printing current directory:

pwd

Getting the list the items in the current directory

$ ls

Change current directory

cd  ‘newdir’ 

Remove a file:

rm ‘file-to-remove’

Remove an empty folder/directory using the recursive specification:

$ rm -r ‘directory-to-remove/’

Remove a directory plus its contents:

$ rm -rf ‘directory-to-remove/’

Relocate a file

$ mv ‘file.txt’  ‘target-folder/’

Make a new directory

$ mkdir ‘newdirectory’

Make a child directory under a specific parent directory

$mkdir /olddir/newdir

Force exit a program: Enter ‘top’ in terminal to get the process id of the program, then type

$kill ‘process id’

Or by the name of the program using the pkill command:

pkill firefox

To print the last 25 commands:

$ history 25

Checking installation path of an app

$ which ‘whatever application’

e.g.

which mongo

returns

Downloading something from web

wget ‘www.whatever.com/…’

Making a text file using the cat command:

Installing an app:

$sudo apt update

$sudo snap install zoom-client

To launch

download something from web

$ wget ‘weblink’

Here is the link to get R studio

$ wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.02.1-461-amd64.deb

Shutdown  

$ shutdown -h now

Shutdown in 95 minutes

$ shutdown -h 95

Or at 10:48 pm

shutdown -h 20:48

Setting file/folder permissions ( Linux’s way of saying you’r welcome!)

Making several commands at the same time using the ‘;’ ‘&&’ and ‘||’ operators:


Available flags:

400  r   Readable by owner only

500  r-X Avoid Changing

600  rW Changeable by user

644  rw-r–r Read and change by user

660  rw-rW Changeable by user and group

700  WX Only user has full access

755  rwxr-xr-X  Only changeable by user

775  rwxrwxr-X  Sharing mode for a group a

777  rwxrwxrwx  Everybody can do everything

e.g. making a file readable, writeable and executable by everyone.

chmod 777 ‘filepath’

making all files in dir readable, writeable and executable by everyone.

chmod -R 777 ‘filepath’

or 

chmod -R 777  ./


Installing MongoDB