Linux refers to the family of Unix-like computer operating systems using the Linux kernel. If your question is about a certain distribution only, use a more specific tag.

learn more… | top users | synonyms

26
votes
7answers
68k views

Copy directory contents using 'cp' command

How do you copy all the contents of one directory into another? For example: $ cd /home/newuser $ cp -a /backup/olduser/* . The problem with the above is that the globing pattern '*' matches the ...
26
votes
3answers
2k views

Why does a failed linux login take so long? [duplicate]

Possible Duplicate: Why would an incorrect password attempt take a lot longer to process than a correct one? When you get the correct login credentials, you are logged in immediately. When ...
26
votes
4answers
34k views

Delete matching files in all subdirectories

How can I remove all .swp files in all of my subdirectories under Linux?
26
votes
4answers
42k views

What is effect of CTRL + Z on a unix\Linux application

I was curious and confused that what exactly is the behaviour of CTRl+Z. I know, If a process in running in foreground, and we press ctrl+z, it goes to background. But what exactly happens. Does it ...
26
votes
4answers
23k views

How can I install objdump on Mac OS X?

I want to get the source code of a small command line tool using objdump on Mac OS X. I've used arm-linux-objdump on Linux and find it a great tool. Is there any way to install objdump on OS X? I've ...
26
votes
7answers
5k views

Why create many partitions?

I have noticed that when installing Ubuntu some people create multiple partitions for directories. Like one for root, one for home, one for boot. What is the advantage to doing this over installing ...
26
votes
11answers
16k views

How to Remove the Last 2 Lines of a Very Large File

I have a very large file ~400G, and I need to remove the last 2 lines from it. I tried to use sed, but it ran for hours before I gave up. Is there a quick way of doing this, or am I stuck with sed?
26
votes
3answers
2k views

What's all those users in the /etc/passwd file?

The /etc/passwd is supposed to have a line for every user on the system. Amongst the common username and root there is a bunch of other users. Some examples: timidity:x:114:127:TiMidity++ MIDI ...
26
votes
2answers
22k views

List files bigger than filesize specified

How can I make ls (or any other particular command) to list me only files bigger than a specific file size?
26
votes
4answers
22k views

How do you redirect wget to standard out?

I have a crontab that wgets a PHP page every five minutes (just to run some the PHP code), and I want to send the output to standard out. I couldn't find it in the wget manual. I'm looking for ...
26
votes
1answer
37k views

What is the difference between grep, pgrep, egrep, fgrep?

I'd like a walk through on the differences between grep, pgrep, egrep, and fgrep and how I would use them.
26
votes
3answers
21k views

How do I create a relative symbolic link in Linux?

I need a symlink that resolves relative to the directory it is placed in. What command is used to create such a thing?
26
votes
9answers
40k views

Flow chart software for Linux? [closed]

Been using Visio at work to do flowcharts, and I'm liking how easy it is to do overall, notably creating and linking shapes. I'm trying to find something for Linux that works the same way, or at ...
26
votes
1answer
2k views

Why does deleting from the command line take significantly less time than from a GUI?

Something I wondered about as I was deleting a dozen or so images from my computer: With a quick rm -rf command on the directory's contents, all the images were gone in a snap. When I drag the same ...
26
votes
5answers
28k views

recursive grep: exclude specific directories

I use recursive grep a lot to find source files with specific content. grep -Rni "myfunc" . On large codebases, this can get slow, so I use --incldue to restrict/whitelist extensions. grep -Rni ...
26
votes
4answers
17k views

Is there a linux command like mv but with regex?

For example I want to mv (.*?).sql $1.php, is there a command that lets me specify renaming patterns?
25
votes
3answers
4k views

How accurate is `md5sum`?

When using md5sum to verify the integrity of a file, how accurate is the process? Does a verified MD5 mean that EVERY bit is exactly the same, or is there a threshold that must be broken before ...
25
votes
4answers
10k views

How to lock a file against deletion but still make it writeable?

I want to make a file locked against deletion but still be writeable. How do I do this? The file in question is a Truecrypt volume as a file on a NAS SMB Network share, so I don't want to ...
25
votes
4answers
40k views

How to type special characters in Linux?

In windows there is possibility to type from keyboard special signs by holding alt key and typing a few numbers, that depends on with sign you want to use. Does it work with linux in the same way?
25
votes
4answers
70k views

How to gzip multiple files into one gz file?

I have 100 files: cvd1.txt cvd2.txt ... cvd100.txt How to gzip 100 files into one .gz file so that after I gunzip it, I should have cvd1.txt, cvd2.txt ... cvd100.txt separately? Thanks for your ...
25
votes
7answers
37k views

How do I fix the Shellshock security vulnerability in debian testing/jessie?

The test command x='() { :;}; echo vulnerable' bash shows that my Debian 8 (Jessie) installation is vulnerable, even with the latest updates. Research shows that there's a patch for stable and ...
25
votes
4answers
31k views

How do I do a binary diff on two identically sized files under Linux?

I have two identically sized files, and I need to do a binary diff to check whether they're the same. I'm currently runnnig diff file1.img file2.img but it's taking quite a while to process my ...
25
votes
4answers
33k views

How do I find (and kill) process running on a certain port? [duplicate]

Possible Duplicate: Finding the process that is using a certain port in Linux I'm using Ubuntu Linux 11.04. How do I write a shell script expression that will find the process running on ...
25
votes
5answers
6k views

Sudo vs root; any actual differences?

I'm working with a support member for a product, and he insists that I need to be root to install a series of patches, and that sudo won't work; he doesn't provide a reason but seems very firm in his ...
25
votes
4answers
9k views

bash watch command with colors preserved

From man watch: Non-printing characters are stripped from program output. Use "cat -v" as part of the command pipeline if you want to see them. So how do I use cat -v if I want to see the ...
25
votes
2answers
63k views

clear IP address of Ethernet interface

What is the Linux command to clear IP address of an interface without bringing it down and/or restarting network services. Seems strange ifconfig is able to change IP address but has no option to ...
25
votes
2answers
9k views

What's the difference between “su” with and without hyphen?

I'm quite new to Linux terminal and I'm not quite sure what the difference between su with a hyphen and su without a hyphen is, for example: su - username vs. su username. I looked into the ...
25
votes
5answers
5k views

VirtualBox from an existing partition

I installed VirtualBox on my Ubuntu Hardy Heron installation, and I would like to use it to virtualize Windows for those rare occasions that I actually need to do something there. Unfortunately, I ...
24
votes
16answers
58k views

How do I check whether I am using KDE or Gnome?

or maybe something else? I am using Redhat OS.
24
votes
7answers
49k views

Which is more efficient - tar or zip compression? What is the difference between tar and zip?

I'm working in Linux environment and want to know about tar and zip commands. Which is more efficient - tar or zip? I also need to know the differences between the tar and zip commands. Can anyone ...
24
votes
2answers
41k views

Updating Time : ntpdate[3108]: the NTP socket is in use, exiting

The time on my system is incorrect for some reason. i need to run an update but i can't seem to be able to this is the errror. ntpdate pool.ntp.org 31 Aug 12:31:59 ntpdate[3108]: the NTP socket is in ...
24
votes
9answers
95k views

What is the shell command to display contents of a file?

Like that of .txt or .html
24
votes
4answers
1k views

Why is it possible to change the password of an admin user on linux?

A few days ago, a friend of mine, wanted to show me that he can use my linux even if I don't tell him my password. He entered in GRUB, selected the recovery mode option. My first problem is that he ...
24
votes
5answers
24k views

How Do I Find The Hardware Block Read Size for My Hard Drive?

I'm trying to figure out the optimal size for a large copy from my hard drive using dd. I'm trying to figure out what the best blocksize to use it, which I would assume is the hardware block size for ...
24
votes
2answers
1k views

What problems does udev actually solve?

For that matter, what exactly was wrong with a bunch of static files in /dev? It's apparently unsatisfactory enough for developers to have reinvented this wheel by my count 3 times now (devfs -> udev ...
24
votes
5answers
2k views

Why doesn't Gzip compression eliminate duplicate chunks of data?

I just did a little experiment where I created a tar archive with duplicate files to see if it would be compressed, to my awe, it was not! Details follow (results indented for reading pleasure): $ dd ...
24
votes
2answers
7k views

Maximize window in tmux

tmux shows screen like this: [root@wpc-fc2 init]# |············ |············ ...
24
votes
9answers
6k views

How to track LAN usage? (AKA 'top for LAN')

There's an evil application that is eating ALL my upload bandwidth (I'm brazilian, it's only ~35kbps) for like 80% of the time my PC is turned on. I would like to know if there's any way to track ...
24
votes
8answers
13k views

Linux keylogger without root or sudo! Is it real?

Somebody on Youtube claims to have a keylogger on Ubuntu that was neither executed nor installed as root. The link below shows a demo of it working. http://www.youtube.com/watch?v=Y1fZAZTwyPQ ...
24
votes
4answers
17k views

Uploading files to S3 account from linux command prompt

I've got several large files sitting in my linux hosted account that I need to upload to my S3 account. I dont want to download them first and then upload it into S3. Is there any way I can "upload" ...
24
votes
2answers
24k views

Is it possible to install the Helvetica font on linux?

I don't know too much about the licensing issues surrounding fonts, but I would like to install Helvetica on my machine for my own personal use. I haven't been able to find a whole lot about this on ...
24
votes
1answer
3k views

Is there a way to make bash more TAB friendly?

I use bash on both my Mac and as my cygwin shell. Overall, I'm quite pleased with it. My one complaint however is that its TAB completion isn't as good as Windows Command Line TAB completion. For ...
24
votes
1answer
33k views

Show only current directory name (not full path) on bash prompt

The way my bash prompt is currently configured, it shows the whole path to the current directory. This is annoying when I'm deep inside a directory tree, as the prompt becomes so long that every ...
24
votes
4answers
15k views

Exclude hidden files when searching with Unix/Linux find?

What options do I need to use with find to exclude hidden files?
23
votes
2answers
2k views

Is there a one line command to make chmod interactive?

I am looking for something like: ls | ask_yes_no_for_each_file | chmod +x the_files_approved Or similar syntax. Also could work on other commands that you want individual confirmation for.
23
votes
3answers
3k views

What is the Linux command that encapsulates almost all of the other commands?

I remember that for Linux running in embedded systems, due to size limitations, it can't pack as many commands as in ordinary workstations. So there is a do-it-all command that can mimic almost all ...
23
votes
10answers
106k views

how do you view all threads running on Linux? [closed]

I've used 'top', but I need a tool that can give me an arbitrary-time history of threads that have executed on my system (CentOS 5.4)?
23
votes
3answers
2k views

Sudo su vs su linux

If I enter in the password to su when prompted, it doesnt work while sudo su does. Also, when a command is executed using sudo (command), does sudo automatically execute it by root by default (since ...
23
votes
4answers
29k views

Find all files on server with 777 permissions

I'm looking for a Linux command to go through all the directories on my server and find all files with 777 permission. The output would be a list of all those files with full path.
23
votes
7answers
46k views

Remove file without asking

How can I remove file without asking user if he agrees to delete file? I am writing shell script and use rm function, but it asks "remove regular file?" and I really don't need this. Thank you.