create account

Important Unix/Linux Commands by martin-stuessy

View this thread on: hive.blogpeakd.comecency.com
· @martin-stuessy ·
$0.51
Important Unix/Linux Commands
<center>![](http://i.imgur.com/SswCGMn.jpg)</center>

Linux is very important to me, so here's my way of sharing that with you. I've gathered a list of commands that are useful for anyone trying to get the most out of a Unix or Linux box.

<h2>What does the command dos2unix do?</h2>
“DOS/MAC to UNIX text file format converter … [a] program that converts plain text files in DOS/MAC format to UNIX format.”

<h2>What does the command unix2dos do?</h2>
“UNIX to DOS text file format converter … [a] program that converts text files in UNIX format to DOS format.”

<h2>Some commands are useful for system administrators when running scripts and programs. What are the following pair of commands useful for?</h2>
<b>at and cron</b>
- <b>at</b> let’s you “Queue, examine or delete jobs for later execution … at … read[s] commands from standard input or a specified file which are to be executed at a later time.” Times are accepted in the form HH:MM.
- <b>cron</b> is a daemon that’s used to “... execute scheduled commands”. Crontab files are loaded into memory and cron checks if it should be run in the current minute.

<b>bg and fg</b>
- <b>bg</b> is a BASH_BUILTIN command. It “[resumes] each suspended job ‘jobspec’ in the background”.
- <b>fg</b> is a BASH_BUILTIN command. It “[resumes] jobspec in the foreground, and make it in the current job …”

<b>jobs and nice</b>
- <b>jobs</b> is a BASH_BUILTIN command. It allows for different ways to list running processes, their IDs, when they undergo changes and their general status.
- <b>nice</b> allows the user to “... run a program with modified scheduling priority.” It “run[s] COMMAND with an adjusted niceness, which affects process scheduling. With no COMMAND, print the current niceness.” Niceness is measured from -20 to 19.

<b>watch and dmesg</b>
- <b>watch</b> lets you “... execute a program periodically…” and displays the output of the periodically executed program. The program “... is run every 2 seconds …” by default.
- <b>dmesg</b> “print[s] or control[s] the kernel ring buffer”. Effectively, it lets “users … print out their bootup messages …”.

<h2>What is a daemon (in terms of Unix/Linux jargon)?</h2>
A daemon is a program/process that runs in the background. It lurks invisibly while listening for service requests to respond/act accordingly.

<h2>What are 5 commonly used daemons? How are they usually named?</h2>
<i>I used https://en.wikipedia.org/wiki/List_of_Unix_daemons as my source for these daemons and their descriptions, on top of checking corresponding man pages.</i>

One can often identify a daemon if the program name ends with a ‘d’.
- <b>crond</b>: “Time-based job scheduler …” that “run[s] jobs in the background.”
- <b>inetd</b>: “Listens for network connection requests…” that “...launch a background daemon to handle the request…” that are also known as “...super servers...”
- <b>ftpd</b>: A daemon that listens for “FTP requests from a remote system.”
- <b>sshd</b>: A daemon that listens for SSH requests from remote systems.
- <b>syncd</b>: A daemon that “... keeps the file systems synchronized with system memory.”

<h2>Now some examples: What would be the result of the following commands?</h2>
<b>chmod 775 masterfile</b>
Changes permissions of file with name ‘masterfile’ to read, write and execute for owner and owner group. But only read and write for others.

<b>chmod go+rx myfile</b>
Changes permissions of file with name ‘myfile’ to add read and execute permissions for the owner group and others.

<b>who > textfile</b>
Writes output of who command into file with name ‘textfile’, while overwriting the current content of ‘textfile’. <b>who</b> outputs current logged in users, the time when they logged in and the address they connected from.

<b>ln Masterfile file</b>
Makes link named ‘file’ to a file named ‘Masterfile’. Commands that use ‘file’ will act as if they used ‘Masterfile’.

<b>ps - f</b>
“Full format listing…” of ps command. When I ran it in my shell it gave two processes, their UID, PID, PPID, C, STIME, TTY, TIME and CMD.

<i>Quoted text was taken directly from the man pages</i>

-------

<a href="http://i.imgur.com/SswCGMn.jpg">Image Source</a>

------

Visit my <a href="https://steemit.com/@martin-stuessy">Steemit profile</a> for more prose, philosophy essays and tutorials. If you want to know what I'm up to check out my <a href="https://martinstuessy.com">portfolio</a>.
👍  , , , , , , , , , , , ,
properties (23)
authormartin-stuessy
permlinkimportant-unix-linux-commands
categorytechnology
json_metadata{"tags":["technology","tutorial","writing","life","steemit"],"image":["http://i.imgur.com/SswCGMn.jpg"],"links":["https://en.wikipedia.org/wiki/List_of_Unix_daemons","http://i.imgur.com/SswCGMn.jpg","https://steemit.com/@martin-stuessy","https://martinstuessy.com"],"app":"steemit/0.1","format":"markdown"}
created2017-06-28 04:23:57
last_update2017-06-28 04:23:57
depth0
children7
last_payout2017-07-05 04:23:57
cashout_time1969-12-31 23:59:59
total_payout_value0.414 HBD
curator_payout_value0.092 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,414
author_reputation19,100,061,932,073
root_title"Important Unix/Linux Commands"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id6,429,256
net_rshares58,729,330,352
author_curate_reward""
vote details (13)
@cosmicboy123 ·
great article martin-stuessy check my posts on unix too!
properties (22)
authorcosmicboy123
permlinkre-martin-stuessy-important-unix-linux-commands-20170825t010924662z
categorytechnology
json_metadata{"tags":["technology"],"app":"steemit/0.1"}
created2017-08-25 01:09:24
last_update2017-08-25 01:09:24
depth1
children0
last_payout2017-09-01 01:09:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length56
author_reputation1,971,099,682,805
root_title"Important Unix/Linux Commands"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id12,792,425
net_rshares0
@geechidan ·
Thanks for sharing. I figured I was at least one of a few Steemets using Linux. I use Mint, what about you?
properties (22)
authorgeechidan
permlinkre-martin-stuessy-important-unix-linux-commands-20170628t060536629z
categorytechnology
json_metadata{"tags":["technology"],"app":"steemit/0.1"}
created2017-06-28 06:05:36
last_update2017-06-28 06:05:36
depth1
children2
last_payout2017-07-05 06:05:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length107
author_reputation3,236,323,908,256
root_title"Important Unix/Linux Commands"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id6,437,766
net_rshares0
@martin-stuessy ·
Ubuntu based distros mostly but I've played with arch a bit too. Hope you enjoyed the read
properties (22)
authormartin-stuessy
permlinkre-geechidan-re-martin-stuessy-important-unix-linux-commands-20170628t064736615z
categorytechnology
json_metadata{"tags":["technology"],"app":"steemit/0.1"}
created2017-06-28 06:47:39
last_update2017-06-28 06:47:39
depth2
children1
last_payout2017-07-05 06:47:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length90
author_reputation19,100,061,932,073
root_title"Important Unix/Linux Commands"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id6,440,956
net_rshares0
@geechidan ·
Oh yeah, most definitely did. Thinking about venturing into the Linux administrator world.
properties (22)
authorgeechidan
permlinkre-martin-stuessy-re-geechidan-re-martin-stuessy-important-unix-linux-commands-20170628t065317012z
categorytechnology
json_metadata{"tags":["technology"],"app":"steemit/0.1"}
created2017-06-28 06:53:15
last_update2017-06-28 06:53:15
depth3
children0
last_payout2017-07-05 06:53:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length90
author_reputation3,236,323,908,256
root_title"Important Unix/Linux Commands"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id6,441,433
net_rshares0
@ghasemkiani ·
Very useful article. Thanks. Resteemed.
properties (22)
authorghasemkiani
permlinkre-martin-stuessy-important-unix-linux-commands-20170628t054211058z
categorytechnology
json_metadata{"tags":["technology"],"app":"steemit/0.1"}
created2017-06-28 05:42:18
last_update2017-06-28 05:42:18
depth1
children0
last_payout2017-07-05 05:42:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length39
author_reputation90,438,911,242,538
root_title"Important Unix/Linux Commands"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id6,435,946
net_rshares0
@roguefighter420 ·
this was a very informative article, i am currently learning linux and this helped me a lot.
properties (22)
authorroguefighter420
permlinkre-martin-stuessy-important-unix-linux-commands-20170628t054419919z
categorytechnology
json_metadata{"tags":["technology"],"app":"steemit/0.1"}
created2017-06-28 05:44:27
last_update2017-06-28 05:44:27
depth1
children1
last_payout2017-07-05 05:44:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length92
author_reputation1,773,540,572,574
root_title"Important Unix/Linux Commands"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id6,436,122
net_rshares0
@martin-stuessy ·
Glad I could help!
properties (22)
authormartin-stuessy
permlinkre-roguefighter420-re-martin-stuessy-important-unix-linux-commands-20170628t123013436z
categorytechnology
json_metadata{"tags":["technology"],"app":"steemit/0.1"}
created2017-06-28 12:30:15
last_update2017-06-28 12:30:15
depth2
children0
last_payout2017-07-05 12:30:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length18
author_reputation19,100,061,932,073
root_title"Important Unix/Linux Commands"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id6,470,653
net_rshares0