Learning Linux for nearly one months, often encounter some feelings understand, dig into the discovery and do not understand. Feel understood, a hands-on deadlock. This is a small white from some of the personal sharing, may be very simple, may not be shared, but sharing is not the weight of sharing it!
Next is my nearly one months of my own about the small trouble, small ideas, and usually temporarily used for the things, I hope we have a harvest. Write some miscellaneous, don't mind Oh!
the first is the LS command:
This is the longest we used to learn Linux command, when my teacher told me that LS + wildcard or file name when it is best to follow the LS-d option, then I was very puzzled, although know-D is only listed directory, but why must be-d? Why not add "-D" when you do not search for anything when the LS list lists only the folder directory and files, and if you want to list something you want, if you do not add-D will appear a lot of things? (PS: At the time of practice in the/etc directory, you know that directory file a lot of) Finally after I have been a lot of experiments, I finally found the problem, assuming that if you want to list the ABC folder, when LS does not + "-D" when the distribution list, then the LS will automatically help you expand this folder, shown below to change the folder in all things, but only show one level, not down recursion!
Then I conclude that, LS does not intentionally specify only folders, when you pass a character, if you match to a folder, then the LS command just to help you expand the folder of the first level files, not the endless list. The reason will be listed, is actually a thoughtful small function of LS, it may just think, since you search this file, then you definitely want to see it, simply I will help you list, is not very intimate? (PS: I feel this discovery is stupid)
and then the TR command .
This command to tell the truth I have nothing to discover and no opinion, just want to say something that I often encounter and then some common methods for this command.
"TR" command, we all know that the longest thing to do is to convert characters, in the range I am now learning, often used is "tr-s" Space "" "This command can be a continuous space into a space, or" tr-d "parameter" "in the bulk of the whereabouts of a character. And when you need to cut out a string of data, with tr-s especially useful
and then the alias .
To tell the truth alias this thing I use really not much, it is used by alias new command = ' original command-options/parameters ' I would like to say some of my own superficial understanding of him. First of all, we may not use much of this stuff (PS: only for beginners), until I learned a simple script, I found that a complex and multifunctional custom alias is not a script it? For example, we can create an alias Supertouch and assign it to create a file, and elevate the file's direct permissions to "+x" so when we create a script file, we save the process of chmod modifying permissions afterwards! Is it a lot lighter? Of course, a similar custom alias to see people like it!
Now it's about "
""”
About double quotes, I just want to say that I still have a little dizzy, sometimes with anti-quote function, and sometimes similar to the function of $, and sometimes can () function almost, sometimes also .... Anyway, it's not fun, but I just want to say a little! It is double quotation mark no matter what a paragraph of characters or commands do not use two pairs or more, because the English double quotation marks have wood there!!! Is the first quotation mark, can and second, third, fourth. Random correspondence, not wrong on the ghost!!!!
This is about the short circuit or the
Tell the truth, what with or not ah, from high school mathematics we began to learn, other times different languages, different places, as long as it is with the computer, we all escape with or not, this thing can not think more, think more you will find chaos, so I put some of their tips out
In Linux, when a program executes smoothly, a value of 0 is returned, and a number between 1-255 is returned.
And: False results are false, both true results are true, so with the operation, false results are mostly
Or: There is a true result is true, both false results are false, so or the operation of the real result is mostly
&& Short-circuiting with, if the previous command passes the false then do not execute. Short circuit and many is to seek truth, namely
Need the previous command to pass over the truth PS: "With more radical so the eyes Only true"
|| Short-circuiting or, if the previous command is passed as true, then no execution is required. Short circuit or more is for the sake of false, namely
Need to pass the previous command over false value PS: "or more tolerant so can accommodate false"
This is a mistake I've always made.
Write if judgment, or if you immediately after the end of another line, or honestly add a space, or the error is definitely!!!!
If you write if you can do whatever you want, not necessarily else and then they just have to appear one, but only if you have to judge the good conditions!
In addition, after writing a small nesting or immediately fill the best fi!
some small shortcuts for individuals
2>&1 turns the wrong result into the right result shorthand method: As 2>1 2 is more than 1 so the final proposition is correct, remember, because 2>1 is correct, so 2>&1 is the wrong output into the correct, because 2> 1 is correct.
1>&2 turns the right result into the wrong result shorthand method: As 1>2 and 1 is less than 2 so the final is this proposition is wrong, remember, because 1>2 is wrong, so 1>&2 is the correct output into the wrong, because 1> 2 is wrong.
PS: So it, also learned less than 20 days, this blog is a little bit of their own ideas, if let the big god see estimated will laughed, but it doesn't matter ah! At least this blog has witnessed my growth, hasn't it?
Beginner Linux, some of their own little share