LinuxQuestions.org
Visit Jeremy's Blog.
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 09-09-2012, 02:29 AM   #1
johnyhasan
LQ Newbie
 
Registered: Jun 2012
Posts: 9

Rep: Reputation: Disabled
Post know right command


i write a command:
ls
how can i check this command is right?

plz help me
 
Old 09-09-2012, 02:41 AM   #2
Gunjo
LQ Newbie
 
Registered: Sep 2012
Location: Maharashtra State, India
Distribution: Red Hat Enterprise Linux Server release 6.0 (Santiago)
Posts: 18

Rep: Reputation: Disabled
You can check more about the command details by entering man command Eg. man ls. You will see the details of that command and related options about the same.

For learning basic commands visit linuxcommand.org
 
Old 09-09-2012, 03:17 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
I second the suggestion by Gunjo: the Linux Command Line is a good resource for learning. Moreover you may download the free PDF to have it at hand when you're working off-line.

Regarding your practice with the command line, indeed the man pages are a valid resource (especially as a reminder of the long list of options available to some commands, like ls). You have to pay more attention to those commands that act on files, like rm (potentially very dangerous for obvious reasons), mv, cp and so on. A good practice would be to put an echo in front of the command and review the actual command line before executing it, especially when you use wild cards. Example:
Code:
$ echo rm *.png
rm tides_error_2km.png tides_error.png
if I see the shell substitution has been performed as expected and the command matches what I meant to achieve, then I can safely do:
Code:
$ rm *.png
Another good practice is to check where you are at any time before executing (potentially) dangerous commands and you have pwd to print the path of the current working directory.

Finally, I suggest to carefully read all the error messages you get. In the majority of the cases they reveal what the error is and may give you a clue to what is the right thing to do.
 
1 members found this post helpful.
Old 09-09-2012, 03:29 AM   #4
Gunjo
LQ Newbie
 
Registered: Sep 2012
Location: Maharashtra State, India
Distribution: Red Hat Enterprise Linux Server release 6.0 (Santiago)
Posts: 18

Rep: Reputation: Disabled
Quote:
Originally Posted by colucix View Post
I second the suggestion by Gunjo: the Linux Command Line is a good resource for learning. Moreover you may download the free PDF to have it at hand when you're working off-line.

Regarding your practice with the command line, indeed the man pages are a valid resource (especially as a reminder of the long list of options available to some commands, like ls). You have to pay more attention to those commands that act on files, like rm (potentially very dangerous for obvious reasons), mv, cp and so on. A good practice would be to put an echo in front of the command and review the actual command line before executing it, especially when you use wild cards. Example:
Code:
$ echo rm *.png
rm tides_error_2km.png tides_error.png
if I see the shell substitution has been performed as expected and the command matches what I meant to achieve, then I can safely do:
Code:
$ rm *.png
Another good practice is to check where you are at any time before executing (potentially) dangerous commands and you have pwd to print the path of the current working directory.

Finally, I suggest to carefully read all the error messages you get. In the majority of the cases they reveal what the error is and may give you a clue to what is the right thing to do.
Thanks colucix
 
  


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
Command/Script required to send an email alert in case command will not respond rajaniyer123 Linux - General 1 05-19-2012 01:12 PM
Executing shell command from JSP file with command line arg from URL orcusomega Programming 2 01-13-2012 03:38 PM
Bash Command Line Editor, while typing run another command before executing current? gumaheru Linux - General 5 04-13-2010 11:21 AM
URGENT! Is there any command to get a history command lines and time in SUSE Linux.? igsoper Linux - Software 5 06-25-2009 02:14 AM
LXer: The Linux Command Shell For Beginners: Fear Not The Command Line! LXer Syndicated Linux News 0 12-22-2008 06:30 PM


All times are GMT -5. The time now is 01:02 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