[16:00:56] [## Class Started at Mon Jul 4 16:00:56 2016 ##] [16:00:56] #startclass [16:01:21] roll call please [16:01:22] Moiz Sajid [16:01:22] tabrez khan [16:01:23] Rhitik Bhatt [16:01:23] Avik Mukherjee [16:01:23] Madhuri Muley [16:01:23] Atharva Deshmukh [16:01:24] Deepanshu Kapoor [16:01:24] Suraj Deshmukh [16:01:24] Rahul Bhattacharjee [16:01:25] Akhilesh Dhaundiyal [16:01:25] Varsha R [16:01:26] Pooja Yadav [16:01:26] Mayank Gupta [16:01:27] Harsh Vardhan [16:01:27] Shantanu Acharya [16:01:30] Jogender Kota [16:01:30] pragnavi [16:01:32] Nisha Poyarekar [16:01:33] Abhishek Shrivastava [16:01:33] Saurav Saha [16:01:33] Trishna Guha [16:01:33] Aditya Bayana [16:01:34] Anandprakash Tandale [16:01:34] Vaibhav Jain [16:01:35] Gobinda Akhuli [16:01:35] Suniva Priyadarshini [16:01:35] Prashant Jamkhande [16:01:36] sandeep kumar choudhary [16:01:37] Yashwanth M [16:01:38] Pabitra Pati [16:01:39] Utkarsh Shukla [16:01:41] Priyanka Sharma [16:01:45] Mamoon manzoor [16:01:46] Aniket Khisti [16:01:49] shweta suman [16:01:51] Sandeep Maity [16:01:51] Akshay Shipurkar [16:01:51] Kshitij [16:01:54] Krishna Biradar [16:01:55] Satyajit Bulage [16:02:04] Abhishek Gupta [16:02:05] Rohan Hazra [16:02:10] Shrimadhav U K [16:02:31] Sudeep Mukherjee [16:02:34] Suraj Narwade [16:02:40] Ashwani Pandey [16:02:47] abhishek kashyap [16:02:56] Anushil Kumar [16:03:06] Ganesh Kadam [16:03:07] shalaka shastri [16:03:13] Abheek [16:03:18] Shaurya Kalia [16:03:18] Mahesh Gahlot [16:03:53] So Today we are going to refresh our linux commands session and learn some new commands. [16:03:55] Sudhir Verma [16:04:02] Akshay T S [16:04:03] Aman kumar [16:04:03] Tuhina Chatterjee [16:04:44] So most of you folks are using commands daily basis like 'ls', 'mkdir', 'mv', 'cp' etc right? [16:04:54] yes [16:05:01] yes [16:05:02] Anupama Mandal [16:05:02] How many of you didn't use above commands yet? [16:05:02] yes [16:05:23] yes [16:05:37] Chirath R [16:05:37] Amol Kahat [16:05:47] yes [16:05:51] yes [16:05:52] So before we start our today session everyone open linux terminal so that we all check output of a executed command. [16:06:17] done [16:06:23] Done [16:06:30] done [16:06:33] done [16:06:44] Now folks who didn't use any commands yet can try to execute simple one like ls, mv, cp etc. and just see how useful it is. [16:06:50] done ! [16:07:19] done [16:07:22] done [16:07:31] done [16:07:47] Now I will ask questions and then you folks give answer if you think someone already answered then please don't repeat. [16:08:15] 1. how do you check about system and linux kernel version? [16:08:21] uname -a [16:08:28] uname -r [16:08:29] ! [16:08:35] uname -a [16:08:42] lsb_release -a [16:08:48] pls don't repeat [16:08:55] Good, now everyone execute that command and try to check output (uname -a) [16:08:55] sorry *uname -a [16:08:56] sorry please [16:09:10] Don't repeat answer. [16:09:17] smdeep: bash: lsb_release: command not found [16:09:19] unme -a [16:09:28] uname -a [16:09:39] Richard99: ^^ read above. [16:09:44] uname-a [16:09:50] SpEcHiDe: lsb_release -a [16:10:37] lsb_release -a doesn't show kernel version but only show release information. [16:10:49] SRvSaha: https://www.irccloud.com/pastebin/a2K1Hjb7/output [16:10:59] Onkar Karale [16:11:06] I will give 2 mins everyone to try that out. [16:11:12] ! [16:11:22] SpEcHiDe, this package needs to be installed [16:11:36] theanalyst: ok. sorry. [16:12:19] 2. How do you check about mounted filesystems. [16:12:21] roll call: Buvanesh Kumar [16:12:27] lsblk [16:12:28] mount [16:12:31] df -h [16:12:35] blkid [16:12:37] mount [16:13:21] mount will show you all the mounted devices, everyone please try [16:13:39] lsblk [16:13:52] df will show you system disk space. [16:14:11] ! [16:14:12] lsblk only list out block devices. [16:14:17] next [16:14:21] cleared [16:14:51] cleared [16:15:06] Roll call: Marcos H. Alano. Sorry for being late [16:15:09] ! [16:15:12] Alright everyone please try once and check. [16:15:15] next [16:15:20] next [16:15:24] next [16:15:35] i did not understand the output of mount [16:16:40] akshays: sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel) => means sysfs mounted on /sys with type sysfs and permissions are (rw,nosuid,nodev,noexec,relatime,seclabel) [16:16:43] i could understand lsblk [16:16:54] df -h [16:16:55] use mount -h [16:17:24] abk1: invalid option [16:17:39] 3. How do you know how long your system is up? [16:17:44] uptime [16:17:47] uptime [16:17:49] uptime [16:17:49] uptime [16:17:55] uptime [16:18:11] Again if you have same answer then no need to put here. [16:18:14] SpEcHiDe, mount -h will show the help [16:18:14] top [16:18:14] w also works [16:18:16] uptime [16:18:34] uptime [16:18:44] Everyone try 'uptime' and check how long your system is up. [16:18:45] praveenkumar, difference between uptime and w [16:18:45] uptime [16:18:52] ! [16:19:23] Sorry I am late [16:19:28] avik: w => it will show who is logged on and what they are doing. [16:19:30] next [16:19:44] on command top there is a section showing zombie. What is that about ? [16:19:49] ok thank you [16:20:16] Richard99: we will come back on that. [16:20:28] Right now everyone try uptime. [16:20:41] Richard99, In a parent-child process, then the parent dies but the child still runs (for no reason), it becomes a zombie [16:21:14] s/then/if [16:21:16] arthar360 +1 [16:21:32] okay [16:21:55] clear [16:21:55] Can someone cover me on today's topic? [16:21:59] sorry [16:22:16] typed that by mistake [16:22:38] 4. How do you get all environment variable for a specific prompt you are in. [16:22:44] set [16:22:56] env [16:22:58] env [16:22:59] printenv [16:23:03] env [16:23:24] env [16:23:51] Everyone try printenv and check available environment variables. [16:24:15] ! [16:24:20] next [16:25:01] ! [16:25:02] What is available enviroment. I am not getting a few parameters [16:25:34] [available environment variable] [16:25:46] iKshitij: https://wiki.archlinux.org/index.php/Environment_variables [16:25:49] next [16:25:53] What is the difference between env and printenv? [16:26:16] SRvSaha: try to do man env and then man printenv, you will understand difference. [16:26:53] Going through man pages :/ [16:27:08] 5. How do you print value of a environment variable? [16:27:32] echo $ [16:27:34] echo $variablename [16:27:35] echo $variablename [16:27:57] SRvSaha, printenv shows global variables specific to the system but env shows you all variables including local ones [16:28:32] vbhjain: Thanks [16:28:32] yes, everyone try to execute echo $HOME or echo $variable_name where variable_name should be present in your shell environment. [16:28:53] echo $HOME [16:29:00] sorry [16:30:10] 6. How do you find out which is your current shell (some might using bash, zsh or sh etc..)? [16:30:21] echo $0 [16:30:22] echo $SHELL [16:30:24] echo $SHELL [16:30:44] echo %SHELL [16:30:46] echo $SHELL [16:31:14] echo $shell [16:31:50] Yes everyone try echo $SHELL and you will find out. [16:32:09] tgadsing_, shell should be in caps [16:32:18] praveenkumar, echo $SHELL is unreliable, I can explain if you say [16:32:45] not necessary, abhishekg5. [16:32:53] Go ahead put a link which all of us can refer later. [16:32:59] arthar360: ^^ [16:33:11] praveenkumar, Ok [16:33:39] abhishekg5, tgadsing caps is important [16:33:53] ! [16:33:56] tgadsing_ echo $shell doesn't works [16:33:57] arthar360, exactly [16:34:04] next [16:34:13] edifference between echo $shell and echo $SHELL? [16:34:22] arthar360: why is echo $SHELL unreliable? [16:34:32] I tried the command with small caps and it worked. [16:34:37] praveenkumar, ^^^ [16:34:48] amey use SHELL not shell [16:34:58] SpEcHiDe, As praveenkumar said, I will explain it later [16:35:13] This is two different o/p(s) !! echo $shell - bash || echo $SHELL - /bin/bash [16:35:23] $SHELL: bin/bash [16:35:25] $shell: bash [16:36:04] Got it. /bin/bash [16:36:05] thanks Dlmz [16:36:06] rahuldecoded +1 [16:36:12] rahuldecoded,right. [16:36:30] rahuldecoded, okay thanks:) [16:36:35] arthar360, I guess praveenkumar said you to explain now and put a link later so that we can refer it later as well [16:37:10] arthar360: Public demand go ahead :) [16:38:03] rahuldecoded: srvsaha@XcidCruX:~$ echo $shell gives No Output here . KUBUNTU 15.10 [16:38:33] Ideally, echo $SHELL shouldn't work [16:38:48] s/SHELL/shell [16:38:56] sanket: why it shouldn't work? [16:39:24] praveenkumar: because $shell isn't defined by default? [16:39:25] SRvSaha: Try, echo $SHELL [16:39:35] SRvSaha: try echo $0 [16:39:52] sanket: for some distro yes. [16:40:12] akash_: Yes $echo $SHELL is working fine. Just because rahuldecoded metioned about it, so I have added [16:40:18] 6. How do you check if a service is running or not? [16:40:34] service service_name status [16:40:56] arthar360: which distro are you using? [16:41:11] interesting, rahuldecoded what distro? [16:41:27] f23 [16:41:32] praveenkumar, RHEL 6 [16:41:57] systemctl isrunning service_name for redhat [16:42:04] systemctl status service_name [16:42:05] systemctl status servicename [16:42:10] arthar360: ah then in your case you are right. [16:42:34] yes so who are using latest distro use 'systemctl status service_name' [16:43:17] sudo systemctl xyz status [16:43:18] service service_name status [16:43:24] sudo systemctl xyz status [16:43:25] .0. [16:43:31] oops [16:43:34] sorry [16:43:48] To get the service status you don't need to be sudo. [16:44:02] ok [16:44:05] ! [16:44:07] ! [16:44:19] You need sudo access when try to start/restart/stop a service. [16:44:21] next [16:44:27] So we need to know the name of the process beforehand, the exact name of the process [16:45:11] ● service_name.service [16:45:11] Loaded: not-found (Reason: No such file or directory) [16:45:11] Active: inactive (dead) [16:45:29] SRvSaha: yes if you want to know all the available service then systemctl list-units -t service [16:45:38] next [16:45:45] Answered! [16:45:54] alright [16:46:34] 7. How do you check process in real time (with CPU/MEM usages)? [16:46:39] systemctl does not work for me. [16:46:43] top [16:46:55] top [16:46:56] akorep_: which distro are you using? [16:47:21] ubuntu 14.04 LTS [16:47:31] yes everyone execute 'top' and and check how it is working. [16:47:47] akorep_ , use service --status-all [16:47:49] yes [16:48:15] praveenkumar, thanks! [16:48:21] akorep_: then systemd might be not present in your system so back to service. [16:48:48] Dear all, Why is echo $SHELL is unreliable: https://arthar360.wordpress.com (My first blog btw ;-) ) [16:48:53] akorep_, systemd was introduced in ubuntu after 15.04 [16:49:47] service command in ubuntu has annoyed me many times because it doesnt always work [16:50:09] arther360 +1 [16:50:22] Well, this is the first time I'm using anything related to Linux, so I have no idea of what these commands are or how they work. [16:50:59] akorep_: most of folks are using linux first time so we are here to learn how things works in linux and it's fine. [16:51:24] arther360 +1 [16:51:30] 8. how do check a process id? [16:51:37] ps aux [16:51:39] ps -a [16:51:39] arthar360: try zsh instead of sh [16:51:46] ps -a [16:51:53] ps -e [16:51:57] ps aux| grep [16:52:33] ps -a [16:52:51] ps -a [16:52:52] try ps aux because it will also give you user information about the process and you can grep whatever process for process id. [16:53:23] Thanks. I felt like I was pretty much the only one who hasn't used Linux at all. [16:53:46] ps -a will show you process id but you will not understand from output about the user who executed a specific process. [16:54:15] praveenkumar, +1 [16:54:19] smdeep, Done, doesnt make any difference to which shell you change to [16:54:20] ps -ef [16:54:48] clear [16:54:55] arthar360: ok [16:54:58] For more options better to read man ps and you will find lot of different options. [16:55:02] sorry ! {typo} [16:55:29] 9. How do you check logs if a service failed to execute? [16:55:43] journalctl -xn [16:55:45] journalctl -xe [16:56:18] journalctl [16:56:30] journalctl is also not working for me. [16:56:48] I always prefer journalctl -u so that I can only iterate over specific service logs not all of them. [16:57:03] akorep: because you are using older version of ubuntu [16:57:12] akorep, SInce you are in Ubuntu, you will need to see the logs in /var/log [16:57:26] akorep: when you have time then update it to latest or install fedora-24 [16:57:33] journalctl is not working. [16:57:43] sorry ! {typo} [16:57:56] Is there an alternate command to journalctl like the one with systemctl? [16:58:23] shashank-loki: Again may be because your distro not have support for journalctl (older version of distro don't have it) [16:58:29] I think we need to cat the logs from /var/logs [16:58:34] praveenkumar: I am also using KDE. I tried installing Fedora 23 but it hangs while booting. Is there any issued with Nvidia graphics driver? [16:58:39] in older versions [16:58:42] akorep: you have to check with /var/logs then. [16:59:04] uname -a [16:59:09] sorry [16:59:18] SRvSaha: better to use Fedora 24 [16:59:47] SRvSaha: I don't know because never had a laptop with graphics card but there are lot of thread about graphics driver issue which mostly solved so better to check on google. [16:59:48] smdeep, Is F24 stable? I had a tough time using F23 in December2015 [17:00:01] vharsh: yes it is stable recently released [17:00:03] vharsh: Fedora 24 is one of the best [17:00:10] I liked it more than 22 and 23 [17:00:26] SRvSaha try troubleshoot ! [17:00:27] Any radical changes except inclusion of gcc6 ? [17:00:34] * vharsh finding chagelogs [17:00:47] SRvSaha It will ignore graphics issue [17:00:58] vharsh: we are going offtopic, let me ask last question and then you folks can carry on with discussion [17:01:12] praveenkumar, sorry [17:01:27] 10. how do you kill a process with ID? [17:01:34] kill -9 PID [17:01:35] kill %id [17:01:36] kill -9 [17:01:42] kill pid [17:01:49] kill pid [17:01:50] -9 is used for force kill so use that carefully. [17:01:53] ^ sends a sigterm, ie force [17:02:38] 11. how do you kill if you know process name instead of ID? [17:02:49] killall processname [17:02:52] killall process_name [17:02:53] pkill [rpcessname [17:03:13] xkill [17:03:49] now all of you check man for killall, pkill and xkill and you will understand which to use. [17:04:21] SpEcHiDe, xkill is used to kill the X server applications by clicking on it [17:05:31] That's all I had to referesh some linux commands which we can use everyday to make our life easy. [17:05:39] Any questions? [17:06:04] ! [17:06:07] next [17:06:25] how to kill a parent process?? I gues we need to use pkill there [17:06:36] s/gues/guess [17:06:53] pabitra: you can get parent process ID and then can use kill [17:07:17] ok [17:07:31] pabitra: try ps auxwf it will show parent-child processes. [17:08:00] thanks praveenkumar [17:08:42] Alright now if someone still want to practise linux command then check http://cli.learncodethehardway.org/book/ [17:08:56] ! [17:09:00] next [17:09:18] Can u explain about service command [17:09:22] You [17:09:38] ping [17:09:38] sorry [17:09:42] smdeep: I am just asking is there any such compatibility issue of Nvidia driver? Cause I have been facing the problem in Ubuntu as well. So I had to switch to Kubuntu finding no other alternative :( [17:09:42] praveenkumar: Ok, I'll research on that . Thanks. :) [17:10:02] aman_: https://www.freedesktop.org/wiki/Software/systemd/ check that out, you will find required information. [17:10:12] roll call please [17:10:14] Akshay Shipurkar [17:10:20] Mayank Gupta [17:10:21] Thanks :) [17:10:22] Pooja Yadav [17:10:23] Tejas Gadsing [17:10:25] Rhitik Bhatt [17:10:25] #endclass [17:10:25] [## Class Ended at Mon Jul 4 17:10:25 2016 ##]