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.
58,802
questions
59
votes
5
answers
79k
views
How to run a command after an already running, existing one finishes?
If I start a script that is going to take a long time, I inevitably realize it after I've started the script, and wish I had a way of doing some kind of alert once it finishes.
So, for example, if I ...
59
votes
13
answers
167k
views
How to resume CUPS printer from command line?
I have printer in CUPS that due to driver problems (HP 1010) from time to time goes into pause.
I would like to write a shell script that will execute once per hour to resume a printer in CUPS. But ...
59
votes
11
answers
180k
views
Killing all instances of Chrome on the command-line?
In some cases killing a single tab/process doesn't do it and I need to close Chrome entirely. Since Chrome has multiple processes, how can I close all of them at once?
I know that...
pgrep chrome ...
59
votes
17
answers
126k
views
Using cd to go up multiple directory levels
I'm dealing with java projects which often result in deeply nested folders (/path/to/project/com/java/lang/whatever, etc) and sometimes want to be able to jump, say, 4 directory levels upwards. Typing ...
59
votes
3
answers
71k
views
Linux - some way to keep a live-updating log file open in terminal?
This must've been done before: I want to keep a log file open in terminal so I can monitor updates to it as they occur. My searches are coming up with everything but this situation... I must be ...
59
votes
4
answers
29k
views
Can't rename a file the name of which starts with a hyphen
I'm trying to rename a file with a hyphen at the beginning of its name and both this:
mv -example-file-name example-file-name
and this:
mv '-example-file-name' example-file-name
result in:
mv: ...
59
votes
3
answers
138k
views
What is the equivalent of the Linux command "sudo fdisk -l" in MacOS?
In Linux, the command sudo fdisk -l produces an output that lists all the disks and partitions in the computer. Here is an example:
If I try to use sudo fdisk -l in MacOS X 10.7.5, the output is the ...
59
votes
3
answers
45k
views
Is there a way to find out what application using most of bandwidth in Linux? [closed]
I'm looking for an utility that could show me how much of a bandwidth each process are using. It should just print the data and exit as I want to feed that list into conky.
59
votes
6
answers
88k
views
How to stream my GNU/Linux audio output to Android devices over WI-FI?
I want to stream my audio output over the network (Wi-Fi) to my Android devices. I'm not looking for a music/video streaming solution, but I would stream any audio output of my GNU/Linux desktop to my ...
59
votes
2
answers
29k
views
GNU sort by case-sensitive
The sort utility in Ubuntu 10.04 (Lucid) always sort by case-insensitive, just like if you specify --ignore-case to it.
The two sort just give the same result:
echo -e "c\nb\nB\na" | sort
echo -e "...
58
votes
4
answers
7k
views
Is a file system just the layout of folders?
I have used Windows since childhood, and when I hear the phrase "Windows filesystem" I think of directories (folders) within directories, a folder called SYSTEM, a folder called PROGRAM FILES etc. Is ...
58
votes
2
answers
20k
views
what is the difference between "command && command" and "command ; command"
I see these two usage on Ubuntu "command && command" and "command ; command",
e.g. apt-get update && apt-get upgrade
What would differ if I use apt-get update; apt-get upgrade?
I ...
58
votes
5
answers
28k
views
Linux equivalent command for "open" command on Mac/Windows?
Coming from Mac OS X, you can type:
$ open yourfilehere.txt
and your file will open just as if you had opened it from Finder.
On Windows, one can type:
> start yourfilehere.txt
and it will ...
58
votes
5
answers
106k
views
How do you check how much power a USB port can deliver?
Some laptops have a special USB port that can deliver more power than the other ones. However it is not always easy to identify which one is the good one, nor how much power it can deliver.
So is ...
58
votes
6
answers
27k
views
Two keyboards on one computer. When I write with A I want a US keyboard layout, when I use B I want Swedish. Possible?
I have a laptop which I use an external keyboard with. When I type using the external keyboard I want to use a US keyboard layout, since that's the type of external keyboard I have. On the other hand, ...
58
votes
9
answers
40k
views
Alternative to the tee command without STDOUT
I'm using | sudo tee FILENAME to be able to write or append to a file for which superuser permissions are required quite often.
Although I understand why it is helpful in some situation, that tee ...
58
votes
3
answers
24k
views
How urgent is a *** System restart required *** for security?
To learn a bit of server administration I've set up a simple Ubuntu 14.04 server on which I run a personal website. I've set it to automatically install security updates, but leave out the other ...
57
votes
4
answers
16k
views
What is the purpose of cd ` (backtick)?
The following behaves the same in Fedora and CentOS.
cd mydirectory
works.
cd notadirectory
works (gets an error from Bash).
However,
cd `
gives me some sort of prompt:
>
Nothing I've ...
57
votes
8
answers
10k
views
How do I check if a 2-track WAV file is "really" in stereo?
I have an audio file (WAV format to be specific). When I open it with an editor (e.g. audacity), I see two channels I suspect that the recording is actually mono rather than audio, i.e. I suspect the ...
57
votes
3
answers
43k
views
Can a process be frozen temporarily in linux?
I was wondering if there is a way to freeze any process for a certain amount of time?
What I mean is that: is it possible for one application (probably running as root) to pause the execution of ...
57
votes
4
answers
73k
views
How do I find out what processes are accessing the hard disk in a GNU/Linux-based system?
I'm looking for the equivalent to top for disk access, so I can tell which process(es) are currently reading and/or writing to disk. I'm currently using Ubuntu, but I imagine there's a standard tool ...
57
votes
5
answers
45k
views
Why must a folder be executable?
Permission for files:
chmod 664 myFile // rw-rw-r--
And for folders:
chmod 774 myFolder // rwxrwxr--
If I only use the "read and write" permission, the folders won't show their contents.
What's ...
57
votes
6
answers
15k
views
Equivalent/Alternatives for Alt+Dot in Mac
One thing i miss from the Linux shell is the Alt+Dot shortcut. What it does is insert the last argument of the previous command. It appears to be a trivial technique, but it's really useful.
i.e. if ...
57
votes
3
answers
58k
views
"Private key is missing or invalid when importing a certificate" in Google Chrome
I want to test my web app on https localhost. Unfortunately it seems impossible to remove certificate warning from chrome. First, I generated the certificate like this:
openssl req -x509 -nodes -days ...
57
votes
11
answers
221k
views
Is there a log that records shutdowns in Linux?
I was wondering if there is a log file in Linux which records every time the computer is shut down?
The reason I am asking is I am doing some tests involving how long my laptop battery lasts under ...
57
votes
8
answers
69k
views
Screensharing under Wayland
I am using Wayland with Fedora 25.
Pretty much no screensharing tool works correctly. From Chrome, I can share a Chrome window, but nothing else.
I also have to use zoom.us and when I share a window ...
57
votes
2
answers
62k
views
Difference between /etc/crontab and "crontab -e"
What is the difference between the crontab located in /etc/crontab and the crontab that can be edited using crontab -e?
57
votes
5
answers
218k
views
How to tar directory and then remove originals including the directory?
I'm trying to tar a collection of files in a directory called 'my_directory' and remove the originals by using the command:
tar -cvf files.tar my_directory --remove-files
However it is only removing ...
57
votes
8
answers
63k
views
How to do Rsync-like encrypted backup?
I want to save a backup of my data on a remote server, but never want the backup server to see the data unencrypted.
Editing a single file and backing up should not result in everything being ...
56
votes
8
answers
141k
views
How to list folders using bash commands?
Is there any way to list just the folders in a directory using bash commands? ( as the ls command lists all the files and folders )
56
votes
2
answers
180k
views
how to get elements from list in bash?
Here is a LIST:
List = "abcd 1234 jvm something"
How to get the second element "1234" without looping all the list?
56
votes
10
answers
124k
views
Command line SVG and image file viewer in Linux?
Is there any command line (pipeable) graph viewer for SVG, JPG, and PNG images?
I'm particularly looking for a way to pipe the graphs/images to the program, instead of using files, so there must be an ...
56
votes
5
answers
54k
views
Rsync files via intermediate host
I am currently away from my LAN and I need to do a backup of my laptop. I have a somewhat recent copy of my laptop on my server and I usually back the laptop up using rsync. Now I wish to do that, but ...
56
votes
4
answers
154k
views
How do I recursively download a directory using smbclient?
When I try to fetch a directory with get "Path To\Directory\", I get the following error:
NT_STATUS_FILE_IS_A_DIRECTORY opening remote file Path To\Directory
How do I recursively download this ...
56
votes
2
answers
11k
views
Why is my Linux system repeating every command that I type?
I'm using a Ubuntu Linux system, and every command I enter is displayed on the next line, followed by the output of the command. For example:
root@dpkube165:~# ls
ls <--- why is this here?
...
56
votes
1
answer
90k
views
How to create multipart 7zip file in Linux?
How can I create a multipart 7zip file in Linux using the p7zip console client?
Many people referred me to it. My console app is
7-Zip [64] 9.13 beta Copyright (c) 1999-2010 Igor Pavlov 2010-04-...
56
votes
3
answers
92k
views
How can I logout an open, remote SSH session?
I sshed into a Linux machine (bash shell) from a public Windows machine (in our lab) and forgot to log out. I'm now back at my seat in another room and I am too lazy to walk back and log out that ...
56
votes
6
answers
194k
views
fsck an ntfs drive in Linux
Is there a way to fsck/chkdsk an NTFS drive from Linux?
56
votes
1
answer
17k
views
What do those +/- mean if linux job in background finishes (started with &)
If I start a process with an ampersand (&) at the end, it'll be forked to background. When it finishes, I get an output similar to
[1]+ Fertig my_script
I have a localized distribution, but ...
56
votes
4
answers
182k
views
How to ping when behind a proxy?
I am using an HTTP proxy server to connect to the internet.
Because of that my pings are not working
ping www.google.com
says Unreachable Host
How can I configure ping to use the HTTP proxy?
56
votes
2
answers
34k
views
What is the difference between set, env, declare and export when setting a variable in a Linux shell?
What is the difference between set, env, declare and export when setting a variable in a Linux shell, such as bash?
55
votes
5
answers
107k
views
How can I do a HTTP PUT with Wget?
I am trying to use Wget to access a RESTful interface, but I can not figure out how to do HTTP PUT with Wget. How can I do it? Or isn't it prossible?
55
votes
13
answers
74k
views
Getting date and time of system startup in Linux
I know that uptime prints the time a machine has been up and running, but is there an easier (reliable) way to get the date of the start up than counting down from this output?
I tried looking around ...
55
votes
2
answers
424k
views
need iptables rule to accept all incoming traffic
For my test environment i want to accept all incoming traffic, can someone please give me the iptable rule to be added.
My current iptables -L -n output looks like this
Chain INPUT (policy ACCEPT) ...
55
votes
5
answers
74k
views
I want to change DPI with ImageMagick without changing the actual byte-size of the image data
In GIMP there is a very simple way to do what I want. I only have the German dialog installed but I’ll try to translate it. I’m talking about going to Picture -> PrintingSize and then adjusting the ...
55
votes
5
answers
59k
views
Resume rsync over SSH after broken connection?
I have to transfer large amounts of data (>80 GB) over ssh using rsync. Everything is working fine, but the DSL connection where the backup data is sent from will drop once every 24h for up to 3 ...
55
votes
10
answers
42k
views
Disable WLan if Wired/Cable Network is available
The question says it all. All i want is that my W-Lan connection should be disabled whenever a wired connection is available.
What would be the easiest way to do that in Ubuntu/Gnome?
In all guides (...
55
votes
7
answers
185k
views
Run part of a bash script as a different user
I am in Ubuntu 9.04. Is there a way to make part of a script run as a different (non-root) user? If it helps, the part to be run as a different user occurs at the end of the script.
55
votes
2
answers
69k
views
How do I properly set wget to download only new files?
Let's say there's an url, let's call it http://www.some-url.com/folder/
This location has directory listing enabled, therefore I can do this:
wget -r -np http://www.some-url.com/folder/
To download ...
55
votes
3
answers
63k
views
rsync - does it create a temp file during transfer?
As far as I can see rsync doesn't create the file in the target directory until it is complete.
This must mean that it creates the file in a temp directory somewhere and copies the file into the ...