Most Popular
1500 questions
74
votes
3 answers
How does curl protect a password from appearing in ps output?
I noticed some time ago that usernames and passwords given to curl as command line arguments don't appear in ps output (although of course they may appear in your bash history).
They likewise don't appear in /proc/PID/cmdline.
(The length of the…
Wildcard
- 35,316
- 26
- 130
- 258
74
votes
5 answers
Quickly find which file(s) belongs to a specific inode number
I know of this command:
find /path/to/mountpoint -inum
but it is a very slow search, I feel like there has to be a faster way to do this. Does anybody know a faster method?
Alex
- 936
- 1
- 6
- 9
74
votes
3 answers
CIFS vs SAMBA, What are the differences
What are the differences between CIFS and SAMBA? When would you use one over the other? Are there any performance differences between the two?
John
- 931
- 1
- 8
- 8
74
votes
4 answers
How do I run a command as the system administrator (root)
I need to run a command with administrative privileges. Someone said I should run a command as root. How do I do this?
Stefan
- 24,830
- 40
- 98
- 126
74
votes
11 answers
Pdf reader that supports XFA forms (while Adobe Reader for Linux is not supported anymore)?
XFA forms are features of a pdf file involving options to complete fields in certain documents - in many cases official documents. These options may open a calendar, for example, in order to select day, month and year, etc. Usually these forms…
user32012
74
votes
2 answers
How to Count the Number of Lines of an Output?
Let say I have the program:
Calculate.py
Is there a unix command-line that counts the number of lines outputted from my program, Calculate.py?
MEhsan
- 843
- 1
- 6
- 4
74
votes
6 answers
How to safely turn off swap permanently and reclaim the space? (on Debian Jessie)
I installed Debian Jessie with default partitioning on my SSD drive. My current disk partitioning looks like this:
As I have 16GB of RAM, I assume I don't need swap. But since I have other disk drives I may create a swapfile for example, on one of…
Vlastimil Burián
- 27,586
- 56
- 179
- 309
74
votes
2 answers
Why and how are some shared libraries runnable, as though they are executables?
On 32-bit Linux systems, invoking this
$ /lib/libc.so.6
and on 64-bit systems this
$ /lib/x86_64-linux-gnu/libc.so.6
in a shell, provides an output like this:
GNU C Library stable release version 2.10.1, by Roland McGrath et al.
Copyright (C) 2009…
Ho1
- 2,552
- 3
- 20
- 25
74
votes
18 answers
Is there ever a reason to use `cat` when you've got `less`?
I used to use cat to view files. Then I learned that less is usually better, and is a must if the file is longer than a few dozen rows.
My question: Is there ever a reason to use cat instead of less? Is there any situation where cat is a better…
Ram Rachum
- 1,795
- 2
- 15
- 18
74
votes
8 answers
Assigning exit code to a shell local variable
#!/bin/bash
function0()
{
local t1=$(exit 1)
echo $t1
}
function0
echo prints empty value. I expected:
1
Why doesn't t1 variable get assigned the exit command's return value - 1?
user93868
74
votes
3 answers
How does the "tail" command's "-f" parameter work?
$ tail -f testfile
the command is supposed to show the latest entries in the specified file, in real-time right? But that's not happening. Please correct me, if what I intend it to do is wrong...
I created a new file "aaa" and added a line of text…
its_me
- 13,709
- 23
- 54
- 52
74
votes
6 answers
Some M4 macros don't seem to be defined
I am trying reinstall pacman on my Arch Linux distribution. When I run the configure script "configure.ac", I get a bunch of undefined macros:
error: possibly undefined macro: AM_INIT_AUTOMAKE.
If this token and others are legitimate, please use…
SirTasty
- 883
- 1
- 7
- 8
74
votes
4 answers
Limit grep context to N characters on line
I have to grep through some JSON files in which the line lengths exceed a few thousand characters. How can I limit grep to display context up to N characters to the left and right of the match? Any tool other than grep would be fine as well, so long…
dotancohen
- 15,494
- 26
- 80
- 116
74
votes
5 answers
Adding unzipped files to a zipped folder
I'm trying to add unzipped files to an existing already zipped folder say new folder.zip. Is it possible to use zip -r new folder.zip after adding some unzipped files to them? Will this command compress the folder? Is there any alternative to do…
boo na
- 741
- 1
- 5
- 3
74
votes
7 answers
How can I set customise settings for htop?
Occasionally, I need to check resources on several machines throughout our data centres for consolidation recommendations. I prefer htop primarily because of the interactive feel and the display.
Is there a way to customise some settings to my setup…
MrDuk
- 1,527
- 2
- 13
- 27