Most Popular
1500 questions
173
votes
9 answers
Why use swap when there is more than enough free space in RAM?
Using swap space instead of RAM can drastically slow down a PC.
So why, when I have more than enough RAM available, does my Linux system (Arch) use the swap?
Checkout my conky output below:
Also, could this be the cause of speed and…
Stefan
- 24,830
- 40
- 98
- 126
173
votes
3 answers
What is the Fedora equivalent of the Debian build-essential package?
What is the Fedora equivalent of the Debian build-essential package?
Steve Burdine
- 6,131
- 6
- 26
- 21
172
votes
16 answers
How can I do a 'change word' in Vim using the current paste buffer?
I have some text in my paste buffer, e.g. I did a yw (yank word) and now I have 'foo' in my buffer.
I now go to the word 'bar', and I want to replace it with my paste buffer.
To replace the text manually I could do cw and then type the new word.
How…
Michael Durrant
- 41,213
- 69
- 165
- 232
172
votes
10 answers
How to chmod without /usr/bin/chmod?
Today I was told a tale by a Unix trainer where the root password got leaked to the students, and one of the fellas removed the execute permission from /usr/bin/chmod itself. How do you recover chmod in this case and make it executable again? Let's…
Sundar R
- 1,578
- 2
- 10
- 7
172
votes
3 answers
What does "systemctl daemon-reload" do?
I have a service that stopped suddenly. I tried to restart that service but failed and was asked to run: systemctl daemon-reload.
What does it exactly do? What is a daemon-reload?
John
- 1,821
- 2
- 9
- 4
172
votes
2 answers
Bash - how to run a command after the previous finished?
Currently I have a script.sh file with the following content:
#!/bin/bash
wget -q http://exemple.com/page1.php;
wget -q http://exemple.com/page2.php;
wget -q http://exemple.com/page3.php;
I want to execute the commands one by one, when the previous…
drogy
- 1,721
- 2
- 11
- 3
172
votes
15 answers
diff within a line
I have some sql dumps that I am looking at the differences between. diff can obviously show me the difference between two lines, but I'm driving myself nuts trying to find which values in the long list of comma-separated values are actually the ones…
user394
- 14,194
- 21
- 66
- 93
171
votes
7 answers
How to move all files and folders via mv command
How can I move all files and folders from one directory to another via mv command?
Luka
- 2,067
- 3
- 10
- 14
171
votes
3 answers
Make all new files in a directory accessible to a group
Suppose I have two users Alice and Bob and a group GROUPNAME and a folder foo, both users are members of GROUPNAME (using Linux and ext3).
If I save as user Alice a file under foo, the permissions are: -rw-r--r-- Alice Alice. However, is it…
student
- 17,875
- 31
- 103
- 169
170
votes
11 answers
Delete First line of a file
How can I delete the first line of a file and keep the changes?
I tried this but it erases the whole content of the file.
$sed 1d file.txt > file.txt
kickass13
- 1,773
- 3
- 12
- 5
170
votes
10 answers
"no public key available" on apt-get update
When performing apt-get update, I get the following error:
root@ADS3-Debian6:/home/aluno# apt-get update
Atingido http://sft.if.usp.br squeeze Release.gpg
Ign http://sft.if.usp.br/debian/ squeeze/contrib Translation-en
Ign…
That Brazilian Guy
- 4,383
- 9
- 25
- 35
170
votes
1 answer
Bash: What does ">|" do?
I have just seen this written down;
$ some-command >| /tmp/output.txt
Vertical pipes are used in standard redirects "piping" the output of one command to another, is >| in fact completely useless as it would be the same as just > in this scenario?
jwbensley
- 7,402
- 11
- 35
- 43
170
votes
10 answers
Command line: How do you rotate a PDF file 90 degrees?
When I scan documents that are landscape-oriented, the output PDF files are portrait and so all the PDF viewers display the scanned documents in portrait.
From the command line, how do you rotate a PDF file 90 degrees?
I tried searching and found a…
Trevor Boyd Smith
- 3,772
- 12
- 36
- 44
170
votes
8 answers
Can I "export" functions in bash?
source some_file
some_file:
doit ()
{
echo doit $1
}
export TEST=true
If I source some_file the function "doit" and the variable TEST are available on the command line. But running this script:
script.sh:
#/bin/sh
echo $TEST
doit test2
Will…
Nils
- 18,202
- 11
- 46
- 82
170
votes
8 answers
Can scp create a directory if it doesn't exist?
I want to use scp to upload files but sometimes the target directory may not exist.
Is it possible to create the folder automatically? If so, how? If not, what alternative way can I try?
AGamePlayer
- 7,415
- 16
- 46
- 55