RSS

Category Archives: Linux

change slingshot shortcut eOS

to change window+space to just windows key.>

gsettings set org.gnome.desktop.wm.keybindings panel-main-menu to [‘Super_L’]”

to revert back>

gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "['<Super>space', '<Alt>F2']"

 
Leave a comment

Posted by on February 12, 2018 in Linux

 

customise plank eOS

command

#plank –preferences

or

Plank has a hidden settings window for developers/OEMs.

  1. Hold down Control and right click anywhere on the dock
  2. Select “Preferences”
  3. make changes.
 
Leave a comment

Posted by on January 17, 2018 in Linux

 

Tags: , , , , ,

Common Linux Commands

1.  ls   list all the contents of a directory  (Display One File Per Line Using ls -1 | Display File Size in Human Readable Format Using ls -lh | Display Hidden Files Using ls -a (or) ls -A | )

2. ll list all the contents of a directory with its permissions, size etc

3. cd / cd .. move in an out of directories

4. mv / cp:         Copy file1 to file2 preserving the mode, ownership and timestamp.

$ cp -p file1 file2

Copy file1 to file2. if file2 exists prompt for confirmation before overwritting it.

$ cp -i file1 file2

mv command examples

Rename file1 to file2. if file2 exists prompt for confirmation before overwritting it.

$ mv -i file1 file2

Note: mv -f is just the opposite, which will overwrite file2 without prompting.

mv -v will print what is happening during file rename, which is useful in some cases.

$ mv -v file1 file2

5. man to find documentation about a command

6. mkdir: to make a directory

mkdir command examples Following example creates a directory called temp under your home directory.

$ mkdir ~/temp

Create nested directories using one mkdir command. If any of these directories exist already, it will not display any error. If any of these directories doesn’t exist, it will create them.

$ mkdir -p dir1/dir2/dir3/dir4/

7. rmdir  to delete a directory

8. touch to create an empty file

9.rm  to remove a file

10. clear (same as cls in winows) clear the clutter from terminal window

11. rm -rf / << the command that we should never use. it will clean the whole system. 

12.TAR: Create a new tar archive.

$ tar cvf archive_name.tar dirname/

Extract from an existing tar archive.

$ tar xvf archive_name.tar

View an existing tar archive.

$ tar tvf archive_name.tar

13. grep : to extract data. check example.

nesi@Alpha:~$ ip route
default via 192.168.1.1 dev enp7s0  proto static  metric 100
default via 192.168.75.3 dev wlp6s0  proto static  metric 600
192.168.1.0/24 dev enp7s0  proto kernel  scope link  src 192.168.1.95  metric 100
192.168.75.0/24 dev wlp6s0  proto kernel  scope link  src 192.168.75.94  metric 600
192.168.250.0/24 dev anbox0  proto kernel  scope link  src 192.168.250.1
nesi@Alpha:~$ ip route | grep default 
default via 192.168.1.1 dev enp7s0  proto static  metric 100
default via 192.168.75.3 dev wlp6s0  proto static  metric 600

14. sudo / su:
su command examples : Switch to a different user account using su command. Super user can switch to any other user without entering their password. some linux distributions nowadays only allow sudo.

$ su - USERNAME

Execute a single command from a different account name. In the following example, john can execute the ls command as raj username. Once the command is executed, it will come back to john’s account.

[john@dev-server]$ su - raj -c 'ls'

[john@dev-server]$

Sudo: is same like “run as administrator” in windows

15. pwd (print working directory) show us the current directory in which the terminal is running on.

16. ps show currently running processes

17. passwd command  : Change your password from command line using passwd. This will prompt for the old password followed by the new password.

$ passwd

Super user can use passwd command to reset others password. This will not prompt for current password of the user.

# passwd USERNAME

Remove password for a specific user. Root user can disable password for a specific user. Once the password is disabled, the user can login without entering the password.

# passwd -d USERNAME

18. ifconfig command :  Use ifconfig command to view or configure a network interface on the Linux system.View all the interfaces along with status.

$ ifconfig -a

Start or stop a specific interface using up and down command as shown below.

$ ifconfig eth0 up

$ ifconfig eth0 down

set IP and SM :

$ ifconfig eth0 192.168.50.5 netmask 255.255.255.0

linux-network-configuration-and-troubleshooting-commands

19. uname command : Uname command displays important information about the system such as — Kernel name, Host name, Kernel release number,
Processor type, etc.,Sample uname output from a Ubuntu laptop is shown below.

$ uname -a
Linux Alpha 4.10.0-35-generic #39~16.04.1-Ubuntu SMP Wed Sep 13 09:02:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

20. whatis command : Whatis command displays a single line description about a command.

$ whatis ls
ls		(1)  - list directory contents

$ whatis ifconfig
ifconfig (8)         - configure a network interface

21. whereis command : When you want to find out where a specific Unix command exists (for example, where does ls command exists?), you can execute the following command.

$ whereis ls
ls: /bin/ls /usr/share/man/man1/ls.1.gz

22. locate command : Using locate command you can quickly search for the location of a specific file (or group of files). Locate command uses the database created by updatedb. The example below shows all files in the system that contains the word crontab in it.

$ locate crontab
/etc/anacrontab
/etc/crontab
/usr/bin/crontab
/usr/share/doc/cron/examples/crontab2english.pl.gz
/usr/share/man/man1/crontab.1.gz

23. tail command : read a text file on terminal.
usage examples: Print the last 10 lines of a file by default.

$ tail filename.txt

Print N number of lines from the file named filename.txt N refers to the number of lines you want to print

$ tail -n N filename.txt

View the content of the file in real time using tail -f. This is useful to view the log files, that keeps growing. The command can be terminated using CTRL-C.

$ tail -f log-file

24. less command : less is very efficient while viewing huge log files, as it doesn’t need to load the full file while opening.

$ less huge-log-file.log

One you open a file using less command, following two keys are very helpful.

CTRL+F – forward one window
CTRL+B – backward one window

25. Kill Command – Kill the process by specifying its PID:  to kill conventions by sending the TERM signal to the specified process. For the signals, either the signal name or signal number can be used. You need to lookup the pid (process ID) for the process and give it as an argument to kill. Use PS or Top to find pid 
exmple:

nesi@Alpha:~$ ps
  PID TTY          TIME CMD
11671 pts/1    00:00:00 bash
12194 pts/1    00:00:00 ps
nesi@Alpha:~$ top
9658 nesi      20   0 1790380 367880  32344 S  12.5  9.3   1:00.76 chromium-b+ 
 3604 nesi       9 -11  592688   6124   4160 S   6.2  0.2   3:39.36 pulseaudio  
12212 nesi      20   0   59776   3524   2948 R   6.2  0.1   0:00.01 top         
    1 root      20   0  185312   2104    840 S   0.0  0.1   0:01.52 systemd     
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.01 kthreadd    
    4 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:+ 
    6 root      20   0       0      0      0 S   0.0  0.0   0:00.15 ksoftirqd/0 
nesi@Alpha:~$ kill 9658

in this case the kill command will kill the chromium app

26. Xkill Command – kill a client by X resource:  xkill is the simplest way to kill a malfunctioning program. When you want to kill a process, initiate xkill which will offer an cross-hair cursor. Click on the window with left cursor which will kill that process. command: xkill

27top shows information about the top processes in the system (sorted by CPU usage by default): top may not be installed by default. Htop is another app that gives a more detailed approach to this purpose.

28. alias : to assign an alias for a command. for example, to update our package repositories we need to run “ sudo apt-get update” which is a long command. using alias we can make it shorter like may be “update” see the another example below:
we often ping to google to check if our internet is working.

nesi@Alpha:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=58 time=87.8 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=58 time=86.4 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=58 time=86.6 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=58 time=87.2 ms
nesi@Alpha:~$ alias g='ping 8.8.8.8'
nesi@Alpha:~$ g
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=58 time=87.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=58 time=86.5 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=58 time=86.7 ms

29. apt / apt-get | install, update, dist-upgrade, remove etc : APT-GET How to

30. hostname : display the host name of the system (in case if you want to change the hostname of your laptop, you have to do it inside /etc/hosts file. open it up in gedit or any other text editor and change it. Ex: “sudo gedit /etc/hosts” )

31. uptime – Reports how long the system has been running since last boot. Extremely useful for servers.

32. lsb_release -a or –all: Displays some relevan all of the above information. For instance, if you are running Arch Linux, this will display
LSB Version: 1.4
Distributor ID: Arch
Description: Arch Linux
Release: rolling
Codename: n/a
   (lsb_release is part of a software package called the LSB core, which is not necessarily installed on your system by default. to install on ubuntu: sudo apt-get update && sudo apt-get install lsb-core | on CentOS :sudo yum update && sudo yum install redhat-lsb-core)

33. who : shows the list of currently logged in users.

34. shutdown: shuts down your computer. You can use shutdown -r to restart your computer. (you may have to run it as root, sudo /su)

 
Leave a comment

Posted by on September 28, 2017 in Linux

 

Tags: , , , ,

Pantheon-Mail stretches horizontally across screen eOS

I read about this error before but never faced it, until today.

I ran a sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade to make my lap up to date. and ended up with to problems. Hopefully I can Fix them. 1. Pantheon-Mail now stretches horizontally across the screen. 2. when I click “network settings” from drop-down menu of network icon on wing panel, it opens “system settings”.

after a brief googling I found solution for the first one.

kill or close pantheon-mail then run the following command on terminal.

dconf reset -f /org/pantheon/mail/

Which will reset the settings of Mail to default. For me after running this it was solved.

(some user said this is not a permanent solution and i may have to run the same when it appears again! )

 
Leave a comment

Posted by on September 14, 2017 in Linux

 

Tags: , , , , , , ,

create permanent alias eOS

Create a file name .bash_aliases in home directory
Then when we need to create a alias open that file in text editor(in my case: Gedit) with root privileges.

sudo gedit ~/.bash_aliases

then create whatever alias you want inside the text file
eg:
alias update="sudo apt-get update"
and save the text file.
as you may have noticed I assigned “update” to “sudo apt-get update”
now whenever I type in the command ‘Update’ on to the terminal it will run “sudo apt-get update”


In the latest versions of Ubuntu, ~/.bashrc automatically sources ~/.bash_aliases, so permanent aliases are best put into this file instead. previously we used to put permanent aliases on  ~/.bashrc

 
Leave a comment

Posted by on September 8, 2017 in Linux

 

Tags: , , , , , ,

Check which is the default file manager – eOS loki

I was in a situation where i couldn’t identify which is my default file manager. after a brief google search I ended up with the following command

what’s the current default file manager?

xdg-mime query default inode/directory

 

 
Leave a comment

Posted by on September 8, 2017 in Linux

 

Tags: , , , , ,

Disable horizontal scroll & enable palm detection eOS loki

In my laptop Libinput is used as my touch-pad driver. this solution is for Libinput. you may have Synaptic as your driver. to check this open terminal and run

 xinput --list

in mine this will give the following result yours may differ.

nesi@Alpha:~$ xinput --list 
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ DLL0651:00 06CB:2985                    	id=11	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Video Bus                               	id=7	[slave  keyboard (3)]
    ↳ Power Button                            	id=8	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=9	[slave  keyboard (3)]
    ↳ Integrated_Webcam_HD                    	id=10	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=12	[slave  keyboard (3)]
    ↳ Dell WMI hotkeys                        	id=13	[slave  keyboard (3)]

Mine is a dell laptop for some reason name of my touch-pad driver is not detected properly. “DLL0651:00 06CB:2985 id=11” this is my touch-pad. if yours is synaptic you’ll see that written here instead.

note the id of the device. mine is 11. then in terminal run the following command to check what options are turned on. [by default a zero = false, and one = true ]

 xinput list-props 11

this will list all options of your touchpad

xinput list-props 11
Device 'DLL0651:00 06CB:2985':
	Device Enabled (140):	1
	Coordinate Transformation Matrix (142):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	libinput Tapping Enabled (275):	1
	libinput Tapping Enabled Default (276):	0
	libinput Tapping Drag Enabled (277):	1
	libinput Tapping Drag Enabled Default (278):	1
	libinput Tapping Drag Lock Enabled (279):	0
	libinput Tapping Drag Lock Enabled Default (280):	0
	libinput Tapping Button Mapping Enabled (281):	1, 0
	libinput Tapping Button Mapping Default (282):	1, 0
	libinput Accel Speed (283):	-0.508333
	libinput Accel Speed Default (284):	0.000000
	libinput Natural Scrolling Enabled (285):	0
	libinput Natural Scrolling Enabled Default (286):	0
	libinput Send Events Modes Available (260):	1, 1
	libinput Send Events Mode Enabled (261):	0, 0
	libinput Send Events Mode Enabled Default (262):	0, 0
	libinput Left Handed Enabled (287):	0
	libinput Left Handed Enabled Default (288):	0
	libinput Scroll Methods Available (289):	1, 1, 0
	libinput Scroll Method Enabled (290):	1, 0, 0
	libinput Scroll Method Enabled Default (291):	1, 0, 0
	libinput Click Methods Available (292):	1, 1
	libinput Click Method Enabled (293):	1, 0
	libinput Click Method Enabled Default (294):	1, 0
	libinput Middle Emulation Enabled (295):	0
	libinput Middle Emulation Enabled Default (296):	0
	libinput Disable While Typing Enabled (297):	1
	libinput Disable While Typing Enabled Default (298):	1
	Device Node (263):	"/dev/input/event12"
	Device Product ID (264):	1739, 10629
	libinput Drag Lock Buttons (299):	
	libinput Horizontal Scroll Enabled (300):	1

check the last option it reads “libinput Horizontal Scroll Enabled (300): 1 “ which means Horizontal scroll is enabled,(value 1 means true). and ID number of the option is 300 given in bracket. In yours ID may be different.

Disable while typing is the option available for Palm Detection. by default it was enabled on my device. if your is showing value 0. note the ID of this option as well.

to change the value of Horizontal scrolling from 1 to 0, type in the following command

xinput set-prop 11 300 0

where,
set-prop: set property
11 : ID of the device whose property is being changed
300 : ID of the option available.
0 : zero to make the value “false”

[in case you want to turn it back on: xinput set-prop 11 300 1 ]

Doing the above will turn off the horizontal scroll for the current section.
if you want to make this change permanent, add that command to startup

goto:

settings >> applications >> startup >> click the + button to add new >> custom command >> type in the command : xinput set-prop 11 300 0

IDs will be different in your system. thats all.

Do the same for any options you need.

[ Update: In case you connect another pointing device later, make sure you connect them after the system has finished loading OS. because otherwise there is a small chance that the ID of your touchpad may change. Today I connected my usb mouse before loading os. and ID of my touchpad changed from 11 to 12, thus my startup command didn’t run. ] 

 
Leave a comment

Posted by on September 8, 2017 in Linux

 

Tags: , , , , , ,

Disable Bluetooth on startup in eOS loki

When I boot my laptop, Bluetooth was on by default:

bluetooth on upon startup

after searching a while I found it is possible to set it to off when I start up my laptop:

bluetooth off

To do this we will edit the “rc.local” file and add a command “rfkill block bluetooth

step 1. Open rc.local as root in a text editor. in my case I used Gedit.

sudo gedit /etc/rc.local

It will open the rc.local file. Just add the following line just before the last line (which is “exit 0”. )

rfkill block bluetooth

Restart your PC to confirm the change.

 
Leave a comment

Posted by on September 7, 2017 in Linux

 

Tags: , , , , , , , ,

No sound when plugging in headphones – elementary OS Loki

$ alsactl restore

And that’s that! 🙂

I ran into this problem when I connected an aux cable to headphone jack, nothing works when connected on that jack anymore. Above command fixed the issue asap.

 
1 Comment

Posted by on September 7, 2017 in Linux

 

Tags: , , , , , , ,

install libreoffice 5.3 eOS

Foss Linux

LibreOffice 5.3 comes with plenty of new features. The most awaited ribbon interface which is a immensely popular in Microsoft Office is now available in the latest release.

INSTALL LIBREOFFICE 5.3 IN UBUNTU, LINUX MINT, AND ELEMENTARY OS

LibreOffice 5.3 is not yet propagated into the official repositories. Therefore apt-get command will not fetch the latest version. If you already have LibreOffice installed, you should be having version 5.1 as of today (Feb 8, 2017). You can check your LibreOffice version by opening one of the applications from the suite, then click ‘Help’ > ‘About’.

Installed LibreOffice version

UNINSTALL OLDER VERSION OF LIBREOFFICE
STEP 1: Launch ‘Terminal’

STEP 2: Run the following command. Elementary OS users first may need to enable PPA before attempting the below command. This command will remove the LibreOffice suite from your PC.

sudo apt-get remove libreoffice-core

STEP 3: Finally, we shall clean the configuration files using purge command:

sudo apt-get remove --purge libreoffice-core

That’s it. Older version of LibreOffice is now uninstalled from your PC. You can go ahead and install LibreOffice 5.3.

INSTALL LIBREOFFICE 5.3

STEP 1: Since PPA doesn’t have the 5.3 version yet, you need to download the debian binary package (.deb) from official website.

Download LibreOffice 5.3 64-bit version

Download LibreOffice 5.3 32-bit version

STEP 2: I will assume that the downloaded file goes to ‘Downloads’ directory. Extract the contents.

STEP 3: Launch ‘Terminal’.

STEP 4: Navigate into the Downloads directory.

cd Downloads

STEP 5: Use ls command to see the folder contents:

ls

STEP 6: Copy the folder name which was extracted. You have to select the file name and then right-click ‘Copy’.

STEP 7: In my case, it’s a 64-bit version. So I would go into the LibreOffice_5.3.0.3_Linux_x86-64_deb directory.

cd LibreOffice_5.3.0.3_Linux_x86-64_deb

STEP 8: Now go into DEBS directory where all the installation files are located.

cd DEBS

STEP 9: Finally run the dpkg command. and you have finished installing libre Office 5.3 on your computer. Enjoy.

sudo dpkg -i *.deb

(This tutorial is copied for future reference from FossLinux written by Kiran Kumar )

 
Leave a comment

Posted by on September 7, 2017 in Linux

 

Tags: , , , , , ,