Most Popular

1500 questions
80
votes
6 answers

How do I remove all sub-directories from within a directory?

This question is kind of a phase II to the first question I posted at here I have a directory that contains a bunch of sub-directories, .zip files, and other random files not contained within a sub-directory. I'd like a command line script to remove…
Evster
  • 1,695
  • 2
  • 13
  • 12
80
votes
1 answer

Alias for directory listing sorted by time modified in reverse order

When I need to find my recently used files, this command: ls -lt lists in ascending order (by time), when there are lots files, I need to scroll to the top to see needed files, because won't fit in terminal screen. After finding out that tac…
linux-newbie
  • 839
  • 1
  • 7
  • 4
80
votes
7 answers

How to trust self-signed certificate in cURL command line?

I've created a self-signed certificate for foo.localhost using a Let's Encrypt recommendation using this Makefile: include ../.env configuration = csr.cnf certificate = self-signed.crt key = self-signed.key .PHONY: all all:…
l0b0
  • 50,672
  • 41
  • 197
  • 360
80
votes
4 answers

What's the standard for indentation in shell scripts?

Java community use 4 spaces as the unit of indentation. 1 Ruby community use 2 spaces that is generally agreed-upon. 2 What's the standard for indentation in shell scripts? 2 or 4 spaces or 1 tab?
Arturo Herrero
  • 2,386
  • 2
  • 19
  • 18
80
votes
5 answers

Argument list too long for ls

I get the following error when trying to ls *.txt | wc -l a directory that contains many files: -bash: /bin/ls: Argument list too long Does the threshold of this "Argument list" dependent on distro or computer's spec? Usually, I'd pipe the result…
user19016
80
votes
7 answers

How many shells deep I am?

Problem: Find how many shells deep I am. Details: I open the shell from vim a lot. Build and run and exit. Sometimes I forget and open another vim inside and then yet another shell. :( I want to know how many shells deep I am, perhaps even have it…
Pranay
  • 951
  • 1
  • 8
  • 12
80
votes
9 answers

Can a script be executable but not readable?

Is it possible to execute a script if there is no permission to read it? In root mode, I made a script and I want the other user to execute this script but not read it. I did chmod to forbid read and write but allow execute, however in user mode, I…
ashim
  • 967
  • 1
  • 7
  • 10
80
votes
3 answers

How to enable reverse search in zsh?

I recently switched to zsh (finally) and am loving it! So far one thing that I am missing is Ctrl+R to do incremental history search. I have the history set up properly HISTSIZE=10000 SAVEHIST=10000 HISTFILE=~/.zsh_history and I used vi key…
Ali
  • 6,693
  • 6
  • 32
  • 37
80
votes
3 answers

I accidentally typed my password into the login field, is it still secure?

I was looking down at my keyboard and typed my password in because I thought I had already typed my login name. I pressed Enter, then when it asked for the password I pressed Ctrl+c. Should I take some precautionary measure to make sure the password…
hermancain
  • 1,277
  • 3
  • 13
  • 15
80
votes
1 answer

Do I need to do something about "Delta RPMs disabled"?

While updating packages on our CentOS server I got the following message: Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. Do I need to do something about that? Should I just ignore this?
user166758
  • 803
  • 1
  • 6
  • 6
80
votes
3 answers

lsof and listening ports

I am trying to get all the processes listening for a network connection on Mac OS X. netstat does not have the -p option and I am trying with lsof lsof -i -sTCP:LISTEN gives me a fair list of listening processes but not all. I can for example…
Matteo
  • 9,676
  • 4
  • 49
  • 66
80
votes
8 answers

pacman "exists on filesystem" error

I ran sudo pacman -Syu and I got some interesting errors reading: error: failed to commit transaction (conflicting files) and a long list of files followed by exists in filesystem. Full output is here: http://ix.io/lLw It appears that many of…
modulitos
  • 3,097
  • 8
  • 29
  • 44
80
votes
8 answers

How To Install Virtualbox Guest Additions On CentOS via Command Line only

Reading the Virtualbox user manual, I finally got [here], which explains how to install Virtualbox Guest Additions on a Linux guest via Command Line. But it's not clear enough for me (I just started learning some commands). Can someone put down the…
its_me
  • 13,709
  • 23
  • 54
  • 52
80
votes
6 answers

What is a socket?

Could someone explain to me what a socket is? I see it in many acronyms in context of SSL, etc. Also, why is it called a socket? Is it purely because it was what a name they invented? Or was it the first name they came up with?
chrisjlee
  • 8,283
  • 16
  • 49
  • 54
80
votes
3 answers

How can I view gzipped files in less without having to type zless?

I am using Ubuntu, and I would like to be able to type less compressed_text_file.gz and page the contents of the text file in uncompressed form. Is there a way to do this?
Ryan C. Thompson
  • 5,398
  • 6
  • 29
  • 23