Most Popular

1500 questions
181
votes
7 answers

How big is the pipe buffer?

As a comment in I'm confused as to why "| true" in a makefile has the same effect as "|| true" user cjm wrote: Another reason to avoid | true is that if the command produced enough output to fill up the pipe buffer, it would block waiting for true…
Kit Sunde
  • 4,394
  • 10
  • 30
  • 34
180
votes
7 answers

What does the @ mean in ls -l?

I am using Mac OSX. When I type ls -l I see something like drwxr-xr-x@ 12 xonic staff 408 22 Jun 19:00 . drwxr-xr-x 9 xonic staff 306 22 Jun 19:42 .. -rwxrwxrwx@ 1 xonic staff 6148 25 Mai 23:04 .DS_Store -rw-r--r--@ 1 xonic staff …
Larry Wang
  • 2,625
  • 4
  • 20
  • 11
179
votes
7 answers

Can't use exclamation mark (!) in bash?

I'm trying to use the curl command to access a http url with a exclamation mark (!) in its path. e.g: curl -v "http://example.org/!287s87asdjh2/somepath/someresource" the console replies with bash: ... event not found. What is going on here? and…
netbrain
  • 2,125
  • 2
  • 15
  • 12
179
votes
6 answers

How do I set a user environment variable? (permanently, not session)

This is irritating me. I seen several suggestions (all using different files and syntax) and none of them worked. How do I set an environment variable for a specific user? I am on debian squeeze. What is the exact syntax I should put in the file to…
user4069
179
votes
3 answers

Finding all large files in the root filesystem

I have a linux server, which currently has below space usage: /dev/sda3 20G 15G 4.2G 78% / /dev/sda6 68G 42G 23G 65% /u01 /dev/sda2 30G 7.4G 21G 27% /opt /dev/sda1 99M 19M 76M 20%…
Abhishek dot py
  • 2,333
  • 4
  • 16
  • 13
178
votes
4 answers

What does ampersand mean at the end of a shell script line?

sh sys-snap.sh & What is sh? What is sys-snap.sh? Why I should put & at the end of the line? Can anyone explain the syntax? Without the & the script won't go back to the prompt till I press Ctrl+C. With & I can press enter and it works.
user4951
  • 10,329
  • 28
  • 71
  • 92
178
votes
9 answers

What to do when a Linux desktop freezes?

I'm a Windows guy, dual booted recently, and now I'm using Linux Mint 12 When a Windows desktop freezes I refresh, or if I am using a program I use alt + F4 to exit the program or I can use ctrl + alt + delete and this command will allow me to fix…
Lynob
  • 4,054
  • 12
  • 44
  • 73
178
votes
5 answers

How to get only files created after a date with ls?

With the ls command, is it possible to show only the files created after a specific date, hour...? I'm asking it because I have a directory with thousand of files. I want so see all files that were created since yesterday. I use ls -ltr but I have…
Luc M
  • 4,025
  • 5
  • 30
  • 29
177
votes
5 answers

How to copy all files from a directory to a remote directory using scp?

My goal is copy only all files from ~/local_dir to [email protected] /var/www/html/target_dir using scp and do not create local_dir category in local_dir. /var/www/html/target_dir/files.. but not /var/www/html/target_dir/local_dir/files.. when use -r…
Edgaras Karka
  • 2,447
  • 5
  • 15
  • 14
177
votes
9 answers

What does the Broken pipe message mean in an SSH session?

Sometimes my SSH session disconnects with a Write failed: Broken pipe message. What does it mean? And how can I keep my session open? I know about screen, but that's not the answer I'm looking for. I think this is a sshd config option.
Peter Stuifzand
  • 2,001
  • 2
  • 13
  • 7
177
votes
1 answer

Executing chdir before starting systemd service

Question: Can I kick off a process with systemd and assign that process a working directory of my choosing? I have a service that I want to start with systemd. When that service is being started, I want to be able to assign it a current working…
Mario
  • 1,965
  • 2
  • 12
  • 8
176
votes
3 answers

How to redirect output to a file from within cron?

I have a backup script which I need to run at a particular time of a day so I am using cron for this task and from within cron am also trying to redirect the output of backup script to a logfile. crontab -e */1 * * * * /home/ranveer/backup.sh &>>…
RanRag
  • 5,675
  • 6
  • 20
  • 15
176
votes
1 answer

How to apt-delete-repository?

I would like to run the reverse of this command to remove the non-compatible repository in Debian 8.1 sudo add-apt-repository -y ppa:nemh/systemback where the command add-apt-repository is in the package software-properties-common. I could not…
Léo Léopold Hertz 준영
  • 6,788
  • 29
  • 91
  • 193
176
votes
3 answers

Why ZSH ends a line with a highlighted percent symbol?

I've noticed this on occasion with a variety of applications. I've often thought it was because the output was cancelled early (ctrl+c, for example) or something similar, and zsh is filling in a new line character. But now curiosity has gotten the…
jktravis
  • 2,156
  • 2
  • 13
  • 15
176
votes
10 answers

How do I use cut to separate by multiple whitespace?

I have this input, which is displayed in columns. I would like to get the second last column with the numbers of this sample: [ 3] 1.0- 2.0 sec 1.00 MBytes 8.39 Mbits/sec [ 3] 2.0- 3.0 sec 768 KBytes 6.29 Mbits/sec [ 3] 3.0- 4.0 sec 512…
rubo77
  • 27,777
  • 43
  • 130
  • 199