Questions tagged [linux]

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

Filter by
Sorted by
Tagged with
245 votes
9 answers
857k views

How can I give write-access of a folder to all users in linux?

I installed apache2 on Ubuntu just now, and noticed that the /var/www folder is protected. I can just sudo everything but I would rather just give it write access. How can I do this? I tried sudo ...
Carson Myers's user avatar
  • 3,101
243 votes
13 answers
319k views

Batch converting PNG to JPG in linux

Does anyone know a good way to batch-convert a bunch of PNGs into JPGs in linux? (I'm using Ubuntu). A png2jpg binary that I could just drop into a shell script would be ideal.
nedned's user avatar
  • 3,262
241 votes
5 answers
285k views

Recursively count all the files in a directory [duplicate]

Possible Duplicate: How can I count the number of folders in a drive using Linux? I have a really deep directory tree on my Linux box. I would like to count all of the files in that path, ...
omghai2u's user avatar
  • 2,930
238 votes
5 answers
262k views

What does the asterisk mean after a filename when you type `ls -l`?

I've done an ls -l inside a directory, and my files are displaying like this : james@nevada:~/development/tools/android-sdk-linux_86/tools$ ll total 9512 drwxr-xr-x 3 james james 4096 2010-05-07 ...
user155695's user avatar
  • 3,619
236 votes
10 answers
471k views

How to copy symbolic links?

I have directory that contains some symbolic links: user@host:include$ find .. -type l -ls 4737414 0 lrwxrwxrwx 1 user group 13 Dec 9 13:47 ../k0607-lsi6/camac -> ../../include 4737415 ...
Basilevs's user avatar
  • 2,796
231 votes
11 answers
442k views

Show keys pressed in Linux [closed]

In Windows there is a program called Keyboard Jedi that shows what keys are pressed on the keyboard. Is there an equivalent for Linux?
ftravers's user avatar
  • 2,694
231 votes
3 answers
97k views

What does the 'rc' in `.bashrc`, etc. mean? [duplicate]

Well, this is embarrassing. I feel like I just realised I don't know a loyal colleague's name after working with them for 10 years. "Hey, er... *cough!*, thanks for that great job you did on setting ...
Ian Mackinnon's user avatar
228 votes
7 answers
304k views

Allow non-root process to bind to port 80 and 443?

Is it possible to tune a kernel parameter to allow a userland program to bind to port 80 and 443? The reason I ask is I think its foolish to allow a privileged process to open a socket and listen. ...
jww's user avatar
  • 12.1k
225 votes
6 answers
279k views

How to specify level of compression when using tar -zcvf?

I gzip directories very often at work. What I normally do is tar -zcvf file.tar.gz /path/to/directory Is there a way to specify the compression level here? I want to use the best compression ...
Lazer's user avatar
  • 17.7k
221 votes
18 answers
50k views

What is the advantage of using 'tar' today?

I know that tar was made for tape archives back in the day, but today we have archive file formats that both aggregate files and perform compression within the same logical file format. Questions: ...
MarcusJ's user avatar
  • 2,125
220 votes
7 answers
294k views

Why does Ctrl + V not paste in Bash (Linux shell)?

When I copy something to the clipboard and press Ctrl + V in Bash, nothing happens; However, right clicking and selecting Paste does the job. Why? Is there any reasonable issue (I'm sure there is) ...
Yasser Zamani's user avatar
216 votes
9 answers
412k views

How do I find out what version of Linux I'm running?

Is there a way to determine what version (distribution & kernel version, I suppose) of Linux is running (from the command-line), that works on any Linux system?
Daryl Spitzer's user avatar
216 votes
9 answers
309k views

How can I find only the executable files under a certain directory in Linux?

How can I find only the executable files under a certain directory in Linux?
HaiYuan Zhang's user avatar
212 votes
7 answers
203k views

scp between two remote hosts from my (third) pc

I have two remote hosts. host1-> 10.3.0.1 host2-> 10.3.0.2 Both run an ssh server. The ssh server listens on port 22 in host1 and on port 6969 in host2. Now, using my local machine, I need to copy ...
uwais ibrahim's user avatar
210 votes
9 answers
207k views

How do I configure SSH so it doesn't try all the identity files automatically?

I have been putting my ssh identity files inside my ~/.ssh/ folder. I have probably about 30 files in there. When I connect to servers, I will specify the identity file to use with something like ...
cwd's user avatar
  • 18.1k
206 votes
11 answers
40k views

I accidentally typed password into bash command line

I accidentally typed my password into bash command line, mistaking the Last login: ... line for Wrong password (I was in a hurry). What do I do to cover my trace? What I did was editing .bash_history ...
MaDa's user avatar
  • 2,013
198 votes
8 answers
466k views

How can I create a non-login user?

I'd like to create a user and a group both called subversion on a RHEL 5 system. I looked at the man page for useradd and I guess the command would be just be... useradd subversion However, not sure ...
Ethan's user avatar
  • 3,711
195 votes
4 answers
398k views

How to install local .deb packages with apt-get

Is there a way to install packages store on your HD with apt-get, like apt-get install ./package.deb? If not, how to handle the dependencies in a very very easy way?
Louis's user avatar
  • 2,634
194 votes
14 answers
863k views

How do I select all text from a file with nano?

I open a file in Ubuntu nano editor from the comand line and I want to copy all the contents of the file so I can paste it in an another application outside the shell. So far I can only copy using ...
Elzo Valugi's user avatar
  • 2,051
187 votes
5 answers
90k views

What's like OSX's pbcopy for Linux

In a terminal in OSX I can pipe output to pbcopy and then go into a web browser and paste it. I tried this in Linux with xcopy but when I switch to the browser it just overwrites the clipboard with ...
tony_sid's user avatar
  • 14.3k
184 votes
7 answers
142k views

How to remove old version of installed snaps

I'm new to snap usage, I have few apps installed on my system, something that I notice when run the command df -h I found mounted different versions of the same snap: /dev/loop0 143M 143M ...
rkmax's user avatar
  • 2,171
184 votes
13 answers
550k views

How do I figure out which /dev is a USB flash drive?

I want to mount a USB drive, two of them and I need two different mount points. Unfortunately, the Linux kernel underwent a name change and I can't figure out which /dev location is the right one. Is ...
user avatar
179 votes
12 answers
181k views

Remove a certain line from Bash history file

How can I remove a certain line from history's database?
w0rldart's user avatar
  • 2,983
179 votes
8 answers
266k views

Obtain kernel config from currently running Linux system?

I accidentally deleted my .config for my kernel configuration on Linux, and seem to remember there was a way to retrieve the kernel configuration via the proc filesystem somehow. Is this still ...
Sonny Ordell's user avatar
  • 1,977
174 votes
16 answers
356k views

How to wipe free disk space in Linux?

When a file is deleted, its contents may still be left in the filesystem, unless explicitly overwritten with something else. The wipe command can securely erase files, but does not seem to allow ...
Alex B's user avatar
  • 2,077
172 votes
16 answers
322k views

How to check which timezone in Linux?

Is there a way to check which time zone I'm currently in on Linux?
user avatar
167 votes
9 answers
342k views

How to install npm in alpine linux

So I can't get to install npm in alpine linux. I thought perhaps I can just do a apk add npm but apparently apk search npm returns nothing, even after a apk update. I'm experimenting with all this ...
Shadi's user avatar
  • 1,915
166 votes
7 answers
227k views

No USB devices available in VirtualBox

Oracle VirtualBox is unable to list/filter the USB devices attached to my system. As a result, the guest OS is not able to see any USB device either. This is my configuration: Host: VirtualBox 5.0.0 ...
mguassa's user avatar
  • 1,874
164 votes
16 answers
550k views

How to check the health of a hard drive

My SATA drive started clicking and I was unable to access the data. This is the hard drive in question: HITACHI Deskstar T7K250 HDT722525DLA380 (0A31636) 250GB 7200 RPM 8MB Cache SATA 3.0Gb/s 3.5"...
tony_sid's user avatar
  • 14.3k
161 votes
6 answers
245k views

How to retrieve video file information from command line under Linux?

I'd like to see from command line all informations pertaining to a given video file, including length, quality, bitrate, resolution, audio and video formats, number and language of audio streams and ...
Sekhemty's user avatar
  • 9,396
159 votes
12 answers
287k views

Copy entire file system hierarchy from one drive to another

I would like to copy the entire file system hierarchy from one drive to another..i.e contents of each directory as well as regular files in Linux platform. Would be gratefull to know the best way to ...
Juggler's user avatar
  • 1,691
158 votes
2 answers
309k views

create tar with multiple directories and file locations

I have some scripts and files located in various locations like: /etc/dir1 /var/www/html /home/somedir I want to make a tar file so that it copies files and folders with the location structure. ...
user1492502's user avatar
  • 1,683
158 votes
8 answers
294k views

How can I know the absolute path of a running process?

If I have multiple copies of the same application on the disk, and only one is running, as I can see with ps, how can I know the absolute path to distinguish it from the others?
Jader Dias's user avatar
158 votes
5 answers
202k views

Finding the process that is using a certain port in Linux

I'd like to be able to find out which process is currently using a certain port in Linux. Is there any way to do this?
Evan Fosmark's user avatar
  • 1,805
157 votes
7 answers
270k views

How can I tunnel all of my network traffic through SSH?

Whenever I'm using the internet from an insecure location (such as public wifi) I like to use an ssh tunnel (ssh -D port host) to ensure my traffic can't be sniffed. Unfortunately, there seem to be ...
Jeremy's user avatar
  • 1
156 votes
9 answers
428k views

Linux: find out what process is using all the RAM?

Before actually asking, just to be clear: yes, I know about disk cache, and no, it is not my case :) Sorry, for this preamble :) I'm using CentOS 5. Every application in the system is swapping ...
Tim's user avatar
  • 1,707
156 votes
3 answers
187k views

What does the -p flag do in "mkdir -p"?

What does the -p flag do in mkdir -p?
user27449's user avatar
  • 6,920
155 votes
12 answers
260k views

How can you see the actual hard link by ls?

I run ln /a/A /b/B I would like to see at the folder a where the file A points to by ls.
Léo Léopold Hertz 준영's user avatar
153 votes
4 answers
134k views

How to wget a file with correct name when redirected?

So after some time of searching on Google and Super User (and scanning man pages) I was unable to find an answer to something that (I think) should be simple: If you go here: http://www.vim.org/...
audio.zoom's user avatar
  • 1,743
153 votes
3 answers
331k views

What does /dev/sda in Linux mean?

What does /dev/sda stand for? What does it mean? I have both Fedora and Ubuntu installed and if I explore them using Ext2explore from Windows, I see these names: /dev/sda6 /dev/sda9 Please ...
saplingPro's user avatar
  • 1,689
148 votes
5 answers
19k views

How does Linux know that the new password is similar to the previous one?

A few times I tried to change a user password on various Linux machines and when the new password was similar to the old one, the OS complained that they were too similar. I always wondered, how does ...
ps-aux's user avatar
  • 3,745
148 votes
1 answer
269k views

How do I unzip a tar gz archive to a specific destination?

I want to unpack a .tar.gz file to a specific directory. The archive file is in /root/Documents. I want to unzip it into /root/Desktop/folder. The folder structure in zipped file should be preserved ...
alwbtc's user avatar
  • 2,945
147 votes
15 answers
664k views

Manually closing a port from commandline

I want to close an open port which is in listening mode between my client and server application. Is there any manual command line option in Linux to close a port? NOTE: I came to know that "only ...
user avatar
147 votes
4 answers
237k views

Display each sub-directory size in a list format using one line command in Bash?

I want to get a list of the directories and their sizes in a list format like how you get when you do a ls -l. The thing is that is there a one line command that can do this? I see others have long ...
Patoshi パトシ's user avatar
147 votes
1 answer
147k views

How do I delete all files smaller than a certain size in all subfolders?

I have a folder with many sub-folders containing small tif files (less than 160kb) which have been merged together in bigger pdf files, together with some big multi-page tif files. I want to delete ...
To Do's user avatar
  • 2,480
146 votes
14 answers
444k views

Remove file without asking

How can I remove a file without asking the user if he agrees to delete the file? I am writing shell script and use rm function, but it asks "remove regular file?" and I really don't need ...
hey's user avatar
  • 2,176
146 votes
12 answers
519k views

How to check if I have sudo access?

I recently got into trouble because of this. $sudo vim /etc/motd [sudo] password for bruce: bruce is not in the sudoers file. This incident will be reported. Is there a way to check if I have ...
Bruce's user avatar
  • 3,137
146 votes
6 answers
242k views

How to prevent SSH from disconnecting if it's been idle for a while

I have a ssh connection to a machine which gets disconnected by that machine after 30 minutes of no user input. However, if I start something like top, the connection stays alive. Since this is a ...
Isaac's user avatar
  • 1,874
145 votes
1 answer
556k views

Mount device with specific user rights

How can I mount a device with specific user rights on start up? I still have some problems figuring it out. I would like to mount the divide with uid=1000 and gid=1000. My current entry to the /etc/...
wowpatrick's user avatar
  • 4,379
144 votes
2 answers
150k views

What is the difference between yum, apt-get, rpm, ./configure && make install?

I am new to Linux and am running CentOS. I have come across four ways to update or install software. So far, I've seen: yum install [program] apt-get install [program] rpm -i [program].rpm wget [...
Saif Bechan's user avatar
  • 3,315