Most Popular
1500 questions
244
votes
11 answers
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 current file that I'm editing?
cwd
- 44,479
- 71
- 146
- 167
243
votes
4 answers
How can get a list of all scheduled cron jobs on my machine?
My sysadmin has set up a bunch of cron jobs on my machine. I'd like to know exactly what is scheduled for what time. How can I get that list?
Frank
- 2,771
- 4
- 17
- 9
243
votes
9 answers
What does etc stand for?
What does the "etc" folder in the root directory stand for? I think knowing this will help me remember where certain files are located.
Update: Might be useful for others, the folder is used for "Host specific configuration files" - reference.
David Tang
- 2,541
- 2
- 15
- 7
243
votes
3 answers
Why is 'ls' suddenly wrapping items with spaces in single quotes?
I just noticed that on one of my machines (running Debian Sid) whenever I type ls any file name with spaces has single quotes surrounding it.
I immediately checked my aliases, only to find them intact.
wyatt@debian630:~/testdir$ ls
'test 1.txt' …
Wyatt Ward
- 3,962
- 2
- 14
- 21
243
votes
10 answers
Terminal prompt not wrapping correctly
I have an issue where if I type in very long commands in bash the terminal will not render what I'm typing correctly. I'd expect that if I had a command like the following:
username@someserver ~/somepath $ ssh -i…
Muricula
- 2,540
- 2
- 12
- 6
241
votes
5 answers
How to rsync only new files
I am trying to set up rsync to synchronize my main web server to the remote server by adding newly generated file to the latter.
Here is the command that I use:
rsync -avh --update -e "ssh -i /path/to/thishost-rsync-key"…
supermario
- 3,179
- 5
- 19
- 14
241
votes
4 answers
Combined `mkdir` and `cd`?
is there any way (what is the easiest way in bash) to combine the following:
mkdir foo
cd foo
The manpage for mkdir does not describe anything like that, maybe there is a fancy version of mkdir? I know that cd has to be shell builtin, so the same…
Jasper
- 3,538
- 4
- 16
- 22
241
votes
2 answers
There are stopped jobs (on bash exit)
I get the message There are stopped jobs. when I try to exit a bash shell sometimes. Here is a reproducible scenario in python 2.x:
ctrl+c is handled by the interpreter as an exception.
ctrl+z 'stops' the process.
ctrl+d exits python for…
ThorSummoner
- 4,312
- 6
- 30
- 47
240
votes
11 answers
Where are cron errors logged?
If I setup cron jobs incorrectly they appear to silently fail. Where should I look for an error log to understand what went wrong?
Brian Lyttle
- 2,661
- 3
- 18
- 9
239
votes
9 answers
How to delete directories based on `find` output?
I issue the following command to find the .svn directories:
find . -name ".svn"
That gives me the following results:
./toto/.svn
./toto/titi/.svn
./toto/tata/.svn
How could I process all these lines with rm -fr in order to delete the directories…
Arnaud
- 2,501
- 2
- 12
- 8
238
votes
5 answers
How to get the complete and exact list of mounted filesystems in Linux?
I usually use mount to check which filesystems are mounted. I also know there is some connection between mount and /etc/mtab but I'm not sure about the details. After reading How to check if /proc/ is mounted I get more confused.
My question is: How…
xanpeng
- 5,595
- 7
- 24
- 20
238
votes
10 answers
What makes grep consider a file to be binary?
I have some database dumps from a Windows system on my box. They are text files. I'm using cygwin to grep through them. These appear to be plain text files; I open them with text editors such as notepad and wordpad and they look legible. However,…
user394
- 14,194
- 21
- 66
- 93
238
votes
3 answers
What's the difference between semicolon and double ampersand &&
What is the difference between
echo "Hello " ; echo "world"
and
echo "Hello " && echo "world"
Both seems to run the two commands after each other.
lindhe
- 4,096
- 3
- 20
- 34
238
votes
8 answers
Find where inodes are being used
So I received a warning from our monitoring system on one of our boxes that the number of free inodes on a filesystem was getting low.
df -i output shows this:
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/xvda1 524288 422613 …
phemmer
- 70,657
- 19
- 188
- 223
238
votes
8 answers
What's the difference between /sbin/nologin and /bin/false
Technically, unless pam is set up to check your shell with pam_shells neither of these can actually prevent your login, if you're not on the shell. On my system they are even different sizes, so I suspect they actually do something. So what's the…
xenoterracide
- 57,918
- 74
- 184
- 250