Most Popular

1500 questions
109
votes
2 answers

What is this new /run filesystem?

I just ran df -h a minute ago and noticed a filesystem has been added that I'm not familiar with. Does anyone know why /run exists? Is this something that's been added by the kernel? By Arch Linux? run 10M 236K 9.8M 3% /run
xenoterracide
  • 59,188
  • 74
  • 187
  • 252
109
votes
9 answers

Press space to continue

How do I stop a bash script until a user has pressed Space? I would like to have the question in my script Press space to continue or CTRL+C to exit and then the script should stop and wait until Space is pressed.
rubo77
  • 28,966
109
votes
7 answers

how to glob every hidden file except current and parent directory

I want to glob every hidden file and directory, but not the current (.) and parent directory (..). I am using bash. Observe current behaviour: $ ls -a . .. ...a ...aa ..a ..aa .a .aa .aaa a $ echo * a $ echo .* . .. ...a ...aa ..a ..aa .a…
Lesmana
  • 27,439
109
votes
2 answers

What is the difference between -m conntrack --ctstate and -m state --state

I'm reading this howto, and there's something like this: We can allow established sessions to receive traffic: $ sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT The above rule has no spaces either side of the comma in…
108
votes
15 answers

GRUB starts in command line after reboot

I installed Linux Mint on my laptop along with a pre-installed Windows 10. When I turn on the computer, the normal GRUB menu appears most of the time: But after booting either Linux or Windows then rebooting, I GRUB starts in command line mode, as…
108
votes
8 answers

#!/bin/bash - no such file or directory

I've created a bash script but when I try to execute it, I get #!/bin/bash no such file or directory I need to run the command: bash script.sh for it to work. How can I fix this?
108
votes
7 answers

Is Mac OS X UNIX?

I had this argument recently saying Mac OS X was not UNIX, but Unix-like. I know there is a Single Unix Specification and those spec compliant could use the UNIX trade mark. Is Mac OS X a UNIX operating system or is it a Unix-like?
OscarRyz
  • 1,275
108
votes
6 answers

How to use a shell command to only show the first column and last column in a text file?

I need some help to figure out how to use the sed command to only show the first column and last column in a text file. Here is what I have so far for column 1: cat logfile | sed 's/\|/ /'|awk '{print $1}' My feeble attempt at getting the last…
user70573
  • 1,319
108
votes
2 answers

How can I restart the SSH daemon on Ubuntu?

When I type in service sshd restart I get a sshd: unrecognized service error. I do have, in /etc/ssh/ a file sshd_config that I use to set config. I can also putty into the Ubuntu box (it is remote). When I type in /etc/init.d/sshd restart I get No…
bharal
  • 1,443
108
votes
5 answers

How can I add an application to the GNOME application menu?

I have an application that I start only from the command line. How can I add the command (and preferably a nice logo) to Gnome's application menu?
mart
  • 1,349
  • 2
  • 10
  • 12
107
votes
9 answers

How can I detect if the shell is controlled from SSH?

I want to detect from a shell script (more specifically .zshrc) if it is controlled through SSH. I tried the HOST variable but it's always the name of the computer which is running the shell. Can I access the hostname where the SSH session is coming…
stribika
  • 5,454
107
votes
3 answers

What is stored in /dev/pts files and can we open them?

According to my knowledge, /dev/pts files are created for ssh or telnet sessions.
user2720323
  • 3,589
107
votes
7 answers

How can I edit symlinks?

My basic understanding of a symlink is that it's a special file, a file that contains a string path to another file. The kernel's VFS abstracts a lot of that away but is there any reason why symlinks seem to be impossible to edit? In other words:…
Oli
  • 16,068
107
votes
5 answers

Installing a .deb package on Arch - Is it possible?

The problem is simple - I have a .deb package and I want to install it on my Arch Linux. Is this possible? If yes, how?
BKC
  • 1,173
107
votes
3 answers

What are character special and block special files in a unix system?

How are character special files and block special files different from regular files in a Unix-like system? Why are they called “character special” and “block special” respectively?
Geek
  • 6,688