Tagged Questions
13
votes
6answers
452 views
How can I edit multiple files in VIM?
I know I can open multiple files with vim by doing something like vim 2011-12*.log, but how can I switch between files and close the files one at a time? Also, how can I tell the file name of the ...
12
votes
2answers
238 views
Accidently created a file called -X, how can I delete it? [closed]
Possible Duplicate:
How do I delete a file whose name begins with “-” (hyphen a.k.a. dash or minus)?
Like an idiot, I ran this command:
tar -cf -X awstats-icon icon ...
10
votes
1answer
139 views
What do all the pictures on the front of the “Unix and Linux System Administration Handbook” represent?
I'm a newcomer to Unix and Linux, and I've been trying to get up to speed on everything. One of the guides I've used is the "Unix and Linux System Administration Handbook"
It's a pretty great book, ...
9
votes
4answers
183 views
Best method to collect a random sample from a collection of files
Suppose there is a directory holding 300 data files. I want to randomly select 200 of those files and move them into another directory. Is there a way to do that under Unix/Linux?
9
votes
7answers
728 views
What's the easiest way to add text to a file from the command line?
Occasionally I have a thought or note that I want to dump into a file while I am at the terminal. I would want these notes all in the same file, just listed one after the other. I would also like a ...
8
votes
3answers
348 views
How can I use ms-dos style wildcards with ls and mv?
I have the misfortune of coming from a MS-DOS background - but at least it makes me appreciate how much more powerful Linux is. I've been working on getting my Linux-Fu up to par, but there are a ...
8
votes
4answers
3k views
How do I make multiple directories at once in a directory?
I know with mkdir I can do mkdir A B C D E F to create each directory. How do I create directories A-Z or 1-100 with out typing in each letter or number?
7
votes
4answers
608 views
How to attach terminal to detached process?
I have detached a process from my terminal, like this:
$ process &
That terminal is now long closed, but process is still running and I want to send some commands to that process's stdin. Is ...
7
votes
2answers
146 views
`test` and `[` - different binaries, any difference?
I noticed while answering another question that test and [ are different binaries, but the [ manpage pulls up test's. Besides the requirement for an ending ], is there any difference? If not, why are ...
7
votes
2answers
110 views
How can I keep control+d from disconnecting my session?
I regularly ssh to a centos 5 box. Somehow they keys are mapped so that control+d will log me out of my current shell. If I am sudo'ed to another use it puts me back to the previous user. If I am not ...
7
votes
4answers
967 views
How to check password with Linux?
I want to check, from the linux command line, if a given cleartext password is the same of a crypted password on a /etc/shadow
(I need this to authenticate web users. I'm running an embedded linux.)
...
6
votes
4answers
127 views
'mv' equivalent of drag and drop with replace?
In a GUI environment, a drag-and-drop with replace will replace files and entire directories (including contents) with whatever is being copied in. Is there a way to accomplish this same intuitive ...
6
votes
7answers
634 views
How can I “cat” a file and remove commented lines?
I'd like to know if there is a way that I could cat file like php.ini and remove all lines starting with ;
For example, if the file contained this:
; - Show all errors, except for notices
;
...
6
votes
2answers
154 views
What is not shell specific?
Under some answers, I see comments that recommend avoiding shell specific commands in answers.
How do I know which commands, operators, etc exist in all shells? Is there a list of standards?
man ...
6
votes
2answers
351 views
What is a good way of saying “run this after 15 minutes” on a shell?
I use this
sleep 900; <command>
on my shell. Just wanted to know is there is some alternate/better way that you use?