Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,590 members, 7,809,144 topics. Date: Friday, 26 April 2024 at 01:08 AM

Day To Day Linux Terminal Commands - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Day To Day Linux Terminal Commands (1459 Views)

SQL (mysql) Commands To Add Two Or More Column. / Learn Linix : Terminal Commands, Distros, Tools... / Introduction To Basic Terminal Commands For Linux (2) (3) (4)

(1) (Reply) (Go Down)

Day To Day Linux Terminal Commands by kudaisi(m): 11:44am On Apr 01, 2015
I use tons of Linux terminal commands on daily basis, I often forget some and revert back to my note pad where i saved a reference to the command. The aim of this post is to expose Linux commands we use on daily basis in a view to assist newbie Linux users to commands they require to quick start there transition to Linux OS. The approach i encourage us to take is to create a scenario and then write out the command that solved the problem.
Re: Day To Day Linux Terminal Commands by kudaisi(m): 12:02pm On Apr 01, 2015
SCENARIO:
I am working on my computer and coding with gedit. Due to some unknown reason my gedit becomes unresponsive. In windows i'd use task manager on mac i'd force quite.

PROBLEM:
I need to forcefully close gedit.

SOLUTION:
1. In Linux to forcefully close an application you need to use the kill command. To use the kill command however you need the process id of the application.
2. To get the running processes on a Linux computer you use the ps. The caveat to ps command is that it gives you a long list of all the running processes and you may have to scroll all the way to the bottom to find what you are looking for.
3. To find the exact process I am looking for since i know the name i can use the ps command along with grep command and a regular expression for the name of the process.

NOTE: To use both the kill and ps commands you have to be a super user. Depending on your Linux distro it's either su or sudo. Since I am using an Ubuntu distro I am going to be using sudo(super user do)


sudo ps -A | grep gedit*
[sudo] password for yemikudaisi:
-------------
result: 12332 ? 00:02:53 gedit

sudo kill -9 12332

NOTES: The -A flag is necessary because i wanted sleeping processes to be included in the queried
Re: Day To Day Linux Terminal Commands by dajoaneke(m): 12:18pm On Apr 01, 2015
Hi bro, whats your expertise in using Linux? I intend using it for Oracle Database 12c
Re: Day To Day Linux Terminal Commands by kudaisi(m): 12:25pm On Apr 01, 2015
SCENARIO: You are in the linux terminal and you've lost track of the folder you are currently in.

PROBLEM: How do you find out the folder ?

SOLUTION: Print Working Directory

pwd
----------
result: /home/yemikudaisi
Re: Day To Day Linux Terminal Commands by kudaisi(m): 12:42pm On Apr 01, 2015
dajoaneke:
Hi bro, whats your expertise in using Linux? I intend using it for Oracle Database 12c
Intermediary...I guess.
Re: Day To Day Linux Terminal Commands by kudaisi(m): 11:33am On Apr 02, 2015
Re: Day To Day Linux Terminal Commands by kudaisi(m): 11:37am On Apr 02, 2015
SCENARIO:
I saw a software online and i liked, i clicked on the download bottom and a file with .deb (e.g whatever.deb) extension was downloaded to my system.

PROBLEM:
How do i install the file ?

SOLUTION:
1. If you are connected to the internet you can simply double click on the .deb file and Ubuntu software center will do the installation for you. However having an active internet connection is not always the case.
2. The other option is to use the dpkg command. As a matter of fact, behind the scene Ubuntu software center always uses the dpkg to install software downloaded from the internet.

NOTE: You need to be a super user to use this command (use su or sudo command depending on your linux distro)

INSTALL
sudo dpkg -i package.deb

REMOVE
sudo dpkg -r package

REPAIR/MODIFY
sudo dpkg -reconfigure package

REMOVE PACKAGE AND IT'S CONFIGURATION
sudo dpkg -P package

LIST ALL INSTALLED PACKAGES
sudo dpkg -P package
Re: Day To Day Linux Terminal Commands by WhiZTiM(m): 12:36pm On Apr 02, 2015
@OP, nice...
....the previous one on DPKG though... its mostly applicable to Debian based Distros. RedHat uses RPM

Want to start an App or command and detach it from the terminal,
example "gedit"
yourname@yourPC:~$ gedit & disown

Having directory ownership problems, including permission to Read/Write/Execute.
yourname@yourPC:~$ chown yourname:yourname directory_name -R ..."-R" makes it recursive

Having directory permission problems to Read/Write/Execute.
yourname@yourPC:~$ chmod +xrw directory_or_file_name -R ..."-R" makes it recursive. "x" executable. "w" writable. "r" readable

Deny Read/Write/Execute.
yourname@yourPC:~$ chmod -xrw directory_or_file_name -R ..."-R" makes it recursive. "x" executable. "w" writable. "r" readable

Need help with a command?
yourname@yourPC:~$ man command_name

Need to read things one screen view at a time, pipe it to more
yourname@yourPC:~$ command | more

...Hundreds more of essential commands....
My advice is, don't try to cram them all... Just understand how to read man pages first...
You will flow with the commands over time and with experience....
:About Me: longtime Linux User....

1 Like

Re: Day To Day Linux Terminal Commands by kudaisi(m): 2:32pm On Apr 09, 2015
CHANGE DIRECTORY
Working on Linux command line means switching between lot of directories. You should always have the cd command at your finger tips.

cd /usr/local/bin
Re: Day To Day Linux Terminal Commands by danvery2k6(m): 12:38pm On Apr 10, 2015
This is a nice idea. I am a new linux (ubuntu 14.04) user. It will be a good idea to get help from home(Nigeria). Please keep the list coming


I had problem playing videos and audio when I installed ubuntu and i came accross this commands that helped solve my proble

sudo apt-get install ubuntu-restricted-extras

this command installed a whole bunch of plugins for me.
Re: Day To Day Linux Terminal Commands by kudaisi(m): 11:00am On Apr 17, 2015
HOW TO KNOW THE VERSION OF A PACKAGE THAT IS INSTALLED ON YOUR SYSTEM

apt-cache policy <package name>
e.g
sudo apt-cahce policy gedit
[sudo] password for ...:
gedit:
Installed: 3.4.1-0ubuntu1
Candidate: 3.4.1-0ubuntu1
Version table:
*** 3.4.1-0ubuntu1 0
500 http://ftp.snt.utwente.nl/pub/os/linux/ubuntu/ precise/main i386 Packages
100 /var/lib/dpkg/status
Re: Day To Day Linux Terminal Commands by kudaisi(m): 11:01am On Apr 17, 2015
HOW TO INSTALL A SPECIFIC VERSION OF A PACKAGE
sudo apt-get install package=version

e.g
$ sudo apt-get install gparted=0.16.1-1
Reading package lists... Done
Building dependency tree
Reading state information... Done
gparted is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 265 not upgraded.

1 Like

Re: Day To Day Linux Terminal Commands by kudaisi(m): 12:17pm On Apr 17, 2015
DOWNLOAD A WEBSITE FOR OFFLINE VIEWING
wget -e robots=off -H -p -k http://www.thewebsite.com/

1 Like

Re: Day To Day Linux Terminal Commands by kudaisi(m): 12:29pm On Apr 27, 2015
LIST ALL AVAILABLE PACKAGES (DEBIAN DISTRO)
To get the list of all the available packages, type the following command.

$ apt-cache pkgnames
Re: Day To Day Linux Terminal Commands by Nobody: 9:17pm On Apr 27, 2015
Nice one i usually use the

sudo dkpg -i sometimes some software never install till i use the debian files. any code for reducing brightness my Ubuntu 14.04 is broken i think it's xrand but i still feel the battery sapping. I hate Ubuntu angry
Re: Day To Day Linux Terminal Commands by kudaisi(m): 11:22am On Apr 28, 2015
pcguru1:
Nice one i usually use the

sudo dkpg -i sometimes some software never install till i use the debian files. any code for reducing brightness my Ubuntu 14.04 is broken i think it's xrand but i still feel the battery sapping. I hate Ubuntu angry
lol @ I hate Ubuntu angry
To solve your brightness problem install xbacklight as so
sudo apt-get install xbacklight
Then you can manage you brightness within a range of 1-100 as so
xbacklight -set 40
Or if you like to work per current brightness then you can increase or decrease like this
xbacklight -dec 10
xbacklight -inc 10
Re: Day To Day Linux Terminal Commands by kudaisi(m): 11:24am On Apr 28, 2015
HOW DO I CHECK A PACKAGE'S INFORMATION ?
apt-cache show youtube-dl
apt-cache show youtube-dl
Package: youtube-dl
Priority: extra
Section: web
Installed-Size: 2464
Maintainer: Rogério Brito <rbrito@ime.usp.br>
Architecture: all
Version: 2015.04.17-1~webupd8~precise0
Recommends: libav-tools | ffmpeg, libav-tools | ffmpeg (>= 4:0.6) | ffprobe, mplayer2 | mplayer, rtmpdump
Depends: python-pkg-resources, python2.7, python (>= 2.7.1-0ubuntu2), python (<< 2.cool
Filename: pool/main/y/youtube-dl/youtube-dl_2015.04.17-1~webupd8~precise0_all.deb
Size: 648644
MD5sum: 3796efaaf78dd21909e5e440ba0a363c
SHA1: e71064dfdda4a1c451b570bf364625fb392d2c2c
SHA256: 45ca670b804187456d1a93892df811ae973f1dd5e54907626252cdade9f5824f
Description-en: downloader of videos from YouTube and other sites
youtube-dl is a small command-line program to download videos from
YouTube.com and other sites that don't provide direct links to the
videos served.

(1) (Reply)

How To Go For Building An Android App For A Wordpress Blog? / Explaining To Non-programmers How Complex Software Development Is / A 16 Year Old Nigerian Built A Photo-sharing App... Check It Out!

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 33
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.