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.
3,966
questions
94
votes
11
answers
29k
views
Cross-platform file system
I would like my external drives to be readable and writable from Linux, Mac OS X and Windows.
FAT32 works, but the 4 GB file size limit is a showstopper these days. Are there any alternatives?
69
votes
15
answers
338k
views
How to recover a removed file under Linux?
By accident, I used rm on a file I didn't want to delete. Is there a way that I can get it back under Linux?
33
votes
8
answers
15k
views
Booting Linux off USB pendrives
Booting a Linux system off USB pendrives is one of my favorite things.
On a laptop we have the following advantages,
The hard disk drive can be shutdown and that reduces power consumption (hdparm)
...
27
votes
5
answers
58k
views
Clone only space in use from hard disk
Can I use dd, rsync, clonezilla or any tool to clone only space in use in my hard disk in Linux? I need to do a backup from a 1 TB HD (with only 2 GB space in use) into a 500 GB HD.
9
votes
1
answer
3k
views
Uses of single-partition disk configuration
I see in my company's IT installations that there are numerous disks with one partition occupying all of the space on disk. There is typically something like a /dev/sdb with a partition /dev/sdb1, and ...
86
votes
7
answers
115k
views
How to set default user for manually installed WSL distro?
I have cloned a WSL distro using wsl --export and wsl --import, but now, running wsl newdistro always logs me in as root. I understand that the lxrun command is deprecated and want to avoid it. The ...
25
votes
1
answer
30k
views
Shutdown Windows 10 truly for a dual booting system
It seems that "Shut down" in Windows 10 actually means "Shut down and hibernate". This has caused my NTFS partitions cannot be automatically loaded on Linux (Ubuntu 16.04) on my dual-booting laptop. ...
482
votes
7
answers
248k
views
What is the difference between executing a Bash script vs sourcing it?
What is the difference between executing a Bash script like A and sourcing a Bash script like B?
A
> ./myscript
B
> source myscript
393
votes
21
answers
527k
views
How do I detach a process from Terminal, entirely?
I use Tilda (drop-down terminal) on Ubuntu as my "command central" - pretty much the way others might use GNOME Do, Quicksilver or Launchy.
However, I'm struggling with how to completely detach a ...
154
votes
5
answers
191k
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?
32
votes
1
answer
192k
views
How can I add Linux to the new Windows 8 boot manager?
Which OSes can be put into the new bootloader that Windows 8 provides?
It seems to be quite pretty and consistent with the rest of the new Windows 8 design, so it would be cool to put Linux (Ubuntu) ...
31
votes
3
answers
135k
views
Can two users simultaneously share one pc
It's easy to have multiple user accounts on one computer and even switch between accounts without logging off. It is also possible to have more than one display connected to a single computer.
Is it ...
133
votes
16
answers
174k
views
Linux utility for finding the largest files/directories [closed]
I'm looking for a program to show me which files/directories occupy the most space, something like:
74% music
\- 60% music1
\- 14% music2
12% code
13% other
I know that it's possible in KDE3, but ...
65
votes
14
answers
119k
views
Batch convert encoding in files
How can I batch-convert files in a directory for their encoding (e.g. ANSI → UTF-8) with a command or tool?
For single files, an editor helps, but how can I do the mass files job?
8
votes
3
answers
15k
views
find: "-exec rm {} \;" vs. "-delete" - why is the former widely recommended?
Why is it that that articles on find always use -exec rm {} \; in cases where the shorter and easier to type and read -delete seems, as far as I can tell, to work just as well?
I realize there are ...
343
votes
19
answers
305k
views
How to reliably keep an SSH tunnel open?
I use an SSH tunnel from work to go around various idotic firewalls (it's ok with my boss :)). The problem is, after a while the ssh connection usually hangs, and the tunnel is broken.
If I could at ...
159
votes
16
answers
530k
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"...
132
votes
17
answers
177k
views
How to delete all files in a directory except some?
I need to delete all files in a directory, but exclude some of them. For example, in a directory with the files a b c ... z, I need to delete all except for u and p. Is there an easy way to do this?
70
votes
2
answers
133k
views
What does dd conv=sync,noerror do?
What's the effect of adding conv=sync,noerror when backing up an entire hard disk onto an image file?
Is conv=sync,noerror a requirement when doing forensic stuff? If so, why is it the case with ...
11
votes
2
answers
3k
views
Make grub keep its default boot under kernel updates
I dual-boot my machine and I want it to default to boot into windows so that whenever I restart the machine remotely from my home it will be able to get back into Windows (instead of Ubuntu).
The ...
4
votes
1
answer
5k
views
Bash terminal not wrapping text correctly [duplicate]
I am using the gnome-terminal with bash, and when I have a command that should go over the line, it just stays on the same line. So instead of:
echo "abcdefghijklmnopqrstuvwxyz"
I would get
...
216
votes
9
answers
411k
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?
48
votes
4
answers
38k
views
Where is the Linux Subsystem's filesystem located in Windows 10?
It's pretty clear that Windows' 10 "host" filesystem is mounted at /mnt/c/ from "Linux" perspective of view. But is it possible to get an access to "Linux" filesystem from Windows? If so, where it is?
20
votes
1
answer
48k
views
How to create a SOCKS proxy with ssh?
I want to use my computer as a SOCKS proxy. Do you just have to do ssh -D port_number hostname? Do I have to put my Linux username as the hostname?
8
votes
4
answers
217
views
Why does `find` in Linux skip expected results when `-o` is used?
Why in Linux (Debian 8)
touch 1.cpp 1.h
find . -name "*.cpp" -o -name "*.h" -exec echo {} \;
outputs only 1.h while
find . -name "*.cpp" -o -name "*.h"
outputs both? Is it a bug or feature?
559
votes
16
answers
459k
views
Reload a Linux user's group assignments without logging out
When assigning a user's secondary group list using:
# usermod -G <grouplist> <user>
is it possible to force this group assignment to take effect without logging out all running sessions?
...
248
votes
7
answers
253k
views
When should I use /dev/shm/ and when should I use /tmp/?
When should I use /dev/shm/ and when should I use /tmp/? Can I always rely on them both being there on UNIX?
19
votes
3
answers
21k
views
Debian: creating Windows 10 bootable install USB-drive using terminal (dd)
My goal is so simple, the title says it all, but every way I've tried, I've failed. I've read instructions on various sites (besides here) and they all seem to be missing something... this is what I ...
1
vote
1
answer
919
views
Beaglebone Black filesystem resize - incorrect information? "just delete the partition and make a new one"
I am working remotely with a beaglebone black system.
I found this information on youtube about expanding the root filesystem.
https://www.youtube.com/watch?v=FK6wfV_19ac (watch from 12:50)
The ...
250
votes
8
answers
24k
views
What do the parentheses and number after a Unix command or C function mean?
I keep seeing parentheses and a number after a command in Unix or Linux or C function.
For example: man(8), ftok(2), mount(8), etc.
What do these mean? I see them in man too.
139
votes
4
answers
144k
views
How do I get out my embedded Windows 8+ key from a Linux environment?
I have seen other SuperUser questions on this topic: How to find Windows 8 product key? | How to find Windows 8 OEM product key?
However, all of the answers assume you have Windows 8 running.
I've ...
107
votes
9
answers
387k
views
How to access a BitLocker-encrypted drive in Linux?
I have a laptop running Windows 7 Ultimate. I have encrypted my drives using BitLocker. Now I have also installed Lubuntu along with Windows. But my encrypted drives are not visible in Linux. How ...
25
votes
4
answers
40k
views
How to correct 512-byte sector MBR on a 4096-byte sector disk?
Final update:
I already knew what I needed to do to fix this problem; I just didn't know how to do it. I was hoping there would be some ready-made tool to do that automatically - but couldn't find any....
6
votes
1
answer
18k
views
localhost and 127.0.0.1 working but not ip address in wsl windows 10
I recently switched from Linux to WSL2 (Ubuntu 20.04) on Windows 10. When I run any NodeJs application or a server like Apache or Nginx everything works fine on localhost or 127.0.0.1 but doesn't work ...
641
votes
41
answers
534k
views
How to execute a command whenever a file changes?
I want a quick and simple way to execute a command whenever a file changes. I want something very simple, something I will leave running on a terminal and close it whenever I'm finished working with ...
219
votes
7
answers
289k
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) ...
94
votes
12
answers
588k
views
PuTTY Network Error: Software caused connection abort
I have a strange problem: When I'm using PuTTY with SSH connecting to a Linux server hosted in VMware on my local Windows 7, I often get the error saying "Network error: Software caused ...
74
votes
11
answers
98k
views
Automatically mount external drives to /media/LABEL on boot without a user logged in?
This question is similar, but kind of the opposite of what I want. I want external USB drives to be mounted automatically at boot, without anyone logged in, to locations like /media/<label>.
I ...
30
votes
6
answers
100k
views
Connect to Linux by name rather than IP
I'm new to Linux (currently running Ubuntu 10.04) and I have just finished setting up SSH access to my Linux Machine. Currently, I have to use ssh [email protected] to connect but would much rather be ...
21
votes
7
answers
45k
views
How to move from one drive to another that's a different size?
I've run into this scenario a few time: I need to replace a drive because I need more space, it's having problems, moving to a new box, etc.
What's the best way to copy data from one partition size ...
6
votes
1
answer
2k
views
Why does "ls .." show real parent content when I'm inside a symbolic link directory?
$ cd ~
$ ln -s /real/folder symbolic_link
$ cd symbolic_link
$ cd ..
$ ls -l
symbolic_link -> /real/folder/
$ cd symbolic_link
$ ls -l ..
folder
In other words, why the behaviour of cd .. is ...
5
votes
3
answers
6k
views
Possibly a dying hard drive, but reads, writes work - unsure about log entries
I recently received a Linux box having problems with Samba share - first off, couldn't connect, second ls -la showed some I/O error (close to what can be seen below) with no listing.
Now, I've fully ...
2
votes
1
answer
1k
views
DDRescue - Did I do the wrong command which is causing it to take longer then expected
I am running the following command on a 500GB drive:
ddrescue --force --direct /dev/sde2 /home/backups/sde2.img sde2_logfile.ddrescue
However, the time has been almost 24hrs and all it has done so ...
1
vote
1
answer
21k
views
btrfs: browsing subvolumes
I am new to btrfs, and confused about subvolumes, after reading the documentation and experimenting on a local system. I have a Linux Mint system with a btrfs root partition. Mint conveniently ...
18
votes
6
answers
47k
views
How to detach ssh session without killing a running process?
I started a test filesystem resize on a server through ssh, but totally forgot to do that on a screen session. Now it is running, and my laptop has very slow internet. Is there any way that I can keep ...
620
votes
8
answers
846k
views
Permissions on private key in .ssh folder?
I changed my permissions in my .ssh folder and now when I use a piece of software that uses my private key, I have to type my password each time. What should my permissions be on my id_rsa file to ...
171
votes
16
answers
350k
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 ...
68
votes
8
answers
49k
views
How can I log all process launches in Linux?
I would like to get a log of all processes that are launched with the time that they were launched and the arguments they were launched with. Is this possible in Linux?
62
votes
8
answers
127k
views
How can I mount a partition from dd-created image of a block device (e.g. HDD) under Linux?
I have an image of the entire disk created using dd. The disk structure follows:
kent@cow:~$ sudo fdisk -l
Disk /dev/sda: 750.1 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
...
53
votes
6
answers
40k
views
Getting macro keys from a Razer BlackWidow to work on Linux
I picked up a Razer BlackWidow Ultimate that has additional keys meant for macros that are set using a tool that's installed on Windows. I'm assuming that these aren't some fancypants joojoo keys and ...