LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-14-2012, 10:48 PM   #16
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671

The desktop's verb-nouns paradigm becomes more difficult when you have highly repetitive tasks, hundreds or thousands of targets or when the targets are spread across several directories.

Programs like ffmpeg have many options. By putting the options in a script in ~/bin/, you can run it by calling the script with the filename as an argument. Using auto-completion, you may just need to type 6 characters, versus setting options on several tabs of a ffmpeg gui front end. You only have to learn these options once.

For example, to convert a video for my Sansa P2 mp3 player, I just enter "vid2sansap2 <videofile>".
 
Old 04-14-2012, 11:00 PM   #17
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 879

Rep: Reputation: 113Reputation: 113
Running a server I go CLI all day long. Its fast, maximizes custom solutions, saves loads of resources.

Desktop I prefer to run a gui because I've installed everything the way I like it and I know where everything is. Everyday though I can say I am working in a xterminal using CLI because somethings you just can't do with gui or its just faster using a terminal such as making fast edits to files on the fly.

I use debian wheezy with gnome-shell and what can I say, I enjoy the artwork. Its a happier play .
 
Old 04-15-2012, 02:21 PM   #18
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 473

Rep: Reputation: Disabled
Let me sum this up by saying when strictly using a gui advantages and disadvantages are strictly preferential.

Comparing Windows to MacOS to KDE, or Gnome or whatever is like comparing Camero's to Mustang's by the overall appearence. Sure maybe you can really dig deep and find advantages like drag coefficients. (I don't know how to realate drag coefficients back to computers)
In the long run the only real difference is your opinion.

It's when you get under the hood that the real differences emerge (or fail to).

The windows shell is cumbersome and pretty useless. Even with the powershell additions I can't stand using it. There is no comparison to the power of a linux/unix shell.

If you are happy strictly using a GUI, then keep doing it. However, I'm betting you could have done it faster and better in the command line
 
Old 04-15-2012, 03:04 PM   #19
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 877

Rep: Reputation: 184Reputation: 184
Quote:
Originally Posted by mreff555 View Post
The windows shell is cumbersome and pretty useless. Even with the powershell additions I can't stand using it. There is no comparison to the power of a linux/unix shell.
I think you have hit on the reason that when you mention command line to windows users it goes down like a lead balloon. Because the the only CLI they've had exposure to is basically crippled and annoying.

I'm a network engineer and network kit makers seem to think they have to include a GUI with their kit. Almost uniformly the experience is a GUI can make it easier to get something useful done when you don't know what you are doing with the kit, but you should move onto the cli as soon as possible because a GUI becomes a crutch. Yes it helps you when things are difficult, but ultimately it will only get in the way.

A case in point, the other day a colleague went clickity click for most of the day adding a few hundred firewall policies to a Juniper firewall. I finished mine in under an hour on the cli.
 
Old 04-15-2012, 03:38 PM   #20
Nermal
Member
 
Registered: Jan 2009
Distribution: Debian
Posts: 59
Blog Entries: 2

Rep: Reputation: 6
Why use command line....

Errr, Say you want to copy all of your MP3's into one directory:
Code:
find . -name "*.mp3" -exec cp {} /tmp \;
So say you want to do something like backup all you MP3 into a archive file:
Code:
find . -name "*.mps" | cpio -o | gzip -9 | dd of=mp3_backup.cpio.gz
So I have built a new server and I want to put my "$HOME/src" from my machine to another user call fred on new server:
Code:
cd $HOME ; find src -print | cpio -o | ssh fred@new_server cpio -ivBud
I want to kill a process "ssh fred@new_server":
Code:
sudo kill -9 `ps -ef | grep ssh | grep fred | grep new_server | awk '{print $2}'`
What is actually going on on my server:
Code:
top
That's why I use it.

Last edited by Nermal; 04-17-2012 at 05:14 PM. Reason: Pre Coffee... Had a few little errors...
 
Old 04-15-2012, 08:36 PM   #21
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: Fedora14,Scientific 6.1?, Mandriva 2010 ;GO MAGEIA!!!Next up Gentoo
Posts: 838

Rep: Reputation: 52
You can't be a stoic if you look at pictures.

The Command line allows the user to manually pipe the output of one Application (command) to another command. In this way a Command is like using small compiled Application/s and using a interpreter (Bash) to act as a orchestra conductor of sorts. Bash coordinates the functions of the separate commands on the one value.

You don't have to have X server working or installed to use CLI. I doubt anyone uses CLI without using applications that make it civil. I adopted CLI tools that mimic a GUI interface like Screen. There is a link for it's use in my Signature. Screen works great if you use the commands for it in the correct order.Tree is also a good one to use while in CLI. What makes CLI difficult is not having anything to reference to and having to rely on your own memory,(no menus) . If you alleviate this most of the anguish is gone. One or more instance/s of a Bash terminal open on your monitor along with a file open that lists possible commands is like having a GUI menu but without the pictures.
 
Old 04-15-2012, 08:37 PM   #22
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 473

Rep: Reputation: Disabled
Or find every trace of the word mp3s on a hard drive

Code:
dd if=/dev/sda | echo << ~/mp3s | grep "mp3s"
try doing that on windows.
 
Old 04-15-2012, 09:38 PM   #23
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,133
Blog Entries: 2

Rep: Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836
Quote:
Originally Posted by mreff555 View Post
Code:
dd if=/dev/sda | echo << ~/mp3s | grep "mp3s"
Would you mind to explain that, that doesn't make any sense to me, but may be I am overlooking something. Also, it seems to me that you are sometimes over-complicating your scripts.
For example:
Code:
find . -name "*.mps" | cpio -o | gzip -9 | dd of=mps_backup.cpio.gz
dd is not needed here, use redirection.
Code:
find . -name "*.mps" | cpio -o | gzip -9 > mps_backup.cpio.gz
Code:
cd $HOME ; find src -print | cpio -o | ssh gred@new_server cpio -ivBud
I would do it that way:
Code:
rsync -a ~/src fred@new_server:~/
While your code is looking awesome I rather am a fan of short and to the point commands, use as less commands to get to the goal as possible.

Sorry for being off-topic.
 
Old 04-17-2012, 03:47 PM   #24
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 473

Rep: Reputation: Disabled
Actually, my script is shorter than yours.

Also, using DD allows you to evaluate a stream as opposed to just searching recursively through directories.

While it wouldn't make a who lot of sense to use my script it for searching for mp3's. The point of this thread was
to show off the power of the command line.
 
Old 04-17-2012, 05:12 PM   #25
Nermal
Member
 
Registered: Jan 2009
Distribution: Debian
Posts: 59
Blog Entries: 2

Rep: Reputation: 6
**OFF Topic**

Hi TobiSGD,

Totally Agreed with your post, My only comment "If it works it's not wrong."

I come from a Unix background and I have had to support and develop on some really OLD systems.

My use of dd is purely from the days of tapes... Old habits die hard and this would allow me to optimise the block size for writing or stop sector bleeding on none block special devices.

"rsync", while being a awesome program, it is not readily available on all *nix systems.

But as I said at the beginning your not wrong, but neither am I, apart from my smelling mistakes that I have now corrected...
 
Old 04-17-2012, 11:20 PM   #26
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,133
Blog Entries: 2

Rep: Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836
Quote:
Originally Posted by mreff555 View Post
Actually, my script is shorter than yours.
Which of them?

Quote:
Also, using DD allows you to evaluate a stream as opposed to just searching recursively through directories.

While it wouldn't make a who lot of sense to use my script it for searching for mp3's. The point of this thread was
to show off the power of the command line.
It is not that I don't see the use of dd or any other tool, it is simply that I don't understand this line
Code:
dd if=/dev/sda | echo << ~/mp3s | grep "mp3s"
It would really be nice to explain its function to me. As far as I understand it, that line causes dd to write the contents of /dev/sda to stdout, which is piped to echo (which IMHO doesn't make sense, since echo doesn't use input from stdin) while simultaneous feeding the contents of the file ~/mp3s to echo and greping that output for the string "mp3s". I can't get what you try to do here, I really need an explanation for that.
 
Old 04-18-2012, 12:54 AM   #27
Trinfinate
LQ Newbie
 
Registered: Apr 2012
Posts: 5

Rep: Reputation: Disabled
hmmm...as a technology,computer enthusiest/ Artist, it seems like cli is perfect for IT, security, Maitanance and other information systems...basically for gtd( getting things done)....but the gui is perfect for the media industry....i cant imagine editing a photo on cli..lol....or editing a video or music...or playing games...lol...makes sense gtd on editing something visual...would take a visual process....does anybody know were i can find ....like...a...linux command cheat sheet?....it would be awsome if some one could direct me to were i can find ALL of the commands on linx....lol...if not than any command cheat sheet would be fine...thank you my good men...
 
Old 04-18-2012, 07:55 AM   #28
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,133
Blog Entries: 2

Rep: Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836
Try http://linuxcommand.org/index.php, it will give you a first insight. Whenever you have questions about a specific command it is a good idea to look at
Code:
man COMMANDNAME
For example, to learn more about the man command you would do a
Code:
man man
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cursor does not move to the bottom line and overwrite to same line on command line mesuutt Linux - Newbie 3 02-25-2012 08:04 AM
Print all PID folders from /proc line-by-line with this format (( PID: command-line )) courteous Linux - Newbie 7 12-12-2010 04:47 PM
awk command line: blank line record sep, new line field sep robertmarkbram Programming 4 02-21-2010 05:25 AM
xine command line? or some other command line only engine? lumix Linux - Software 2 08-10-2007 10:46 AM


All times are GMT -5. The time now is 02:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration