Most Popular
1500 questions
78
votes
12 answers
How to disable line wrap in a terminal?
I need to view large logs files using a bash shell. I was using less to open the files, but since the lines are too lengthy there is some kind of line/word wrapping going on.
Since the files are Log4J logs, and there is a pattern in the beginning…
nunaxe
- 953
- 1
- 7
- 6
78
votes
4 answers
Run ./script.sh vs bash script.sh - permission denied
When I try to run ./script.sh I got Permission denied but when I run bash script.sh everything is fine.
What did I do wrong?
Piotr Stapp
- 1,003
- 2
- 10
- 10
78
votes
8 answers
Tips for putting ~ under source control
I want to put my home directory (~) under source control (git, in this case), as I have many setting files (.gitconfig, .gitignore, .emacs, etc.) in there I would like to carry across machines, and having them in Git would make it nice for…
Dan McClain
- 883
- 7
- 7
78
votes
3 answers
top command on multi core processor
I am using freescale IMX6 quad processor. I want to know if the top command lists the CPU usage of all 4 cores or of a single core. I am seeing an application's CPU usage being the same with 4 cores and with a single core. I was guessing the CPU…
user3818847
- 1,131
- 2
- 8
- 7
78
votes
5 answers
How to determine which process is creating a file?
Given file path, how can I determine which process creates it (and/or reads/writes to it)?
Anton Barkovsky
- 1,479
- 1
- 13
- 13
78
votes
3 answers
How do I run 32-bit programs on a 64-bit Debian/Ubuntu?
I have a 64-bit (amd64 a.k.a. x86_64) Debian or Ubuntu installation. I need to run 32-bit (i386/i686) programs occasionally, or to compile programs for a 32-bit system. How can I do this with a minimum of fuss?
Bonus: what if I want to run or test…
Gilles 'SO- stop being evil'
- 807,993
- 194
- 1,674
- 2,175
78
votes
5 answers
Is it possible to save as root from nano after you've forgotten to start nano with sudo?
A lot of the time I edit a file with nano, try to save and get a permission error because I forgot to run it as root. Is there some quick way I can become root with sudo from within the editor, without having to re-open and re-edit the file?
Kit Sunde
- 4,394
- 10
- 30
- 34
78
votes
2 answers
Why is bash not storing commands that start with spaces?
If I perform a sequence of commands like:
$ ls
$ grep abc file.txt
and then use the up arrow key to get the previous one, the terminal will show the last cmd (which is the grep here)
But if I do something like this:
$ ls
$ grep abc…
sandyp
- 1,117
- 2
- 8
- 11
78
votes
5 answers
Becoming root from inside Vim
Sometimes I start editing configuration files in /etc using Vim, but forget to use sudo to start Vim. The inevitable result then is that after finishing my edits I encounter the dreaded notice that I don't have the permission to save the file.…
Mad Scientist
- 1,246
- 3
- 12
- 17
78
votes
9 answers
How to find out which file is currently opened in vim?
This may sound trivial but, on more than one occasion, I have found myself having forgotten which file in vim I have open (e.g. when I am looking through different log files and such) and the only way I knew how to find out was to close the file and…
amphibient
- 12,222
- 18
- 62
- 87
78
votes
2 answers
What is the difference between shell, eshell, and term in Emacs?
In Emacs I can run a shell using following commands -
M-x term
M-x shell
M-x eshell
What is the difference between these three?
Kshitiz Sharma
- 8,585
- 21
- 59
- 75
77
votes
1 answer
What does 2>&1 in this command mean?
I understand that this command attempts to write to nowhere or a null device but what does 2>&1 mean here?
wget -q -O - http://yourwebsite.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1
codecowboy
- 3,362
- 7
- 23
- 29
77
votes
11 answers
How can I reliably get the operating system's name?
Say I am logged into a remote system, how can I know what it's running? On most modern Linuxes (Linuces?), you have the lsb_release command:
$ lsb_release -ic
Distributor ID: LinuxMint
Codename: debian
Which as far as I can tell just…
terdon
- 234,489
- 66
- 447
- 667
77
votes
3 answers
Can I rollback an apt-get upgrade if something goes wrong?
Is there a way, before starting an aptitude upgrade or apt-get upgrade, to set up something so that you can "easily" rollback your system to the "apt" state it was before the actual upgrade, if something goes wrong?
That is, for example, reinstall…
Totor
- 19,302
- 17
- 75
- 102
77
votes
14 answers
Unix file naming convention
I was wondering what is the naming convention for files in Unix? I am not sure about this, but I think there is perhaps a universal naming convention that one should follow?
For example, I want to name a file say: backup with part 2 and random…
user4740