Most Popular

1500 questions
114
votes
10 answers

How to grep for same string but multiple files at the same time?

I have a set of log files that I need to review and I would like to search specific strings on the same files at once Is this possible? Currently I am using grep -E 'fatal|error|critical|failure|warning|' /path_to_file How do I use this and search…
user53029
  • 2,813
114
votes
8 answers

Detecting pattern at the end of a line with grep

If I do: $ ls -R .: 4Shared/ Cloud/ ./4Shared: UFAIZLV2R7.part3.rar ./Cloud: UFAIZLV2R7.part2.rar.part UFAIZLV2R7.part1.rar.part UFAIZLV2R7.part4.rar.part If I want to list the .rar files only, and I use grep, it will show me too the .rar.part…
113
votes
4 answers

Can't pipe into diff?

I wanted to be clever and compare a remote file to a local file without first manually downloading it. I can get the contents of the remote file by ssh user@remote-host "cat path/file.name" However, piping that to diff ssh user@remote-host "cat…
user394
  • 14,404
  • 21
  • 67
  • 93
113
votes
5 answers

Why is root login via SSH so bad that everyone advises to disable it?

Everybody on the Internet advises to disable root login via SSH as it is a bad practice and a security hole in the system, but nobody explains why it is so. What is so dangerous in enabling root login (especially with disabled password login)? And…
rush
  • 27,403
113
votes
8 answers

tmux status-bar corrupted after catting a binary file, how to reset?

I accidentally screw up my tmux terminal after cating a binary file. Now my tmux is messed up. Detaching and re-attaching doesn't help, nor does a redraw (C-b r). Running reset only redraws the active pane, not the rest. Running ssty sane either in-…
gerrit
  • 3,487
113
votes
2 answers

What does dash "-" at the end of a command mean?

Given the following command: gzip -dc /cdrom/cdrom0/file.tar.gz | tar xvf – What does the - at the end of the command mean? Is it some kind of placeholder?
Eugene S
  • 3,484
113
votes
3 answers

How do I identify which Linux distro is running?

We have some new hardware in our office which runs its own customized Linux OS. How do I go about figuring which distro it's based on?
mrTomahawk
  • 1,233
  • 2
  • 9
  • 5
113
votes
5 answers

What's the difference between "s" and "S" in ls -la?

When I ls -la, it prints many attributes. Something like this: -rwSrwSr-- 1 www-data www-data 45 2012-01-04 05:17 README Shamefully, I have to confess I don't know the exact meaning of each attributes. For example, what's the meaning of big S in…
Eonil
  • 4,657
113
votes
5 answers

How do I remove the newline from the last line in a file in order to add text to that line?

Suppose I have a file called file: $ cat file Hello Welcome to Unix I want to add and Linux at the end of the last line of the file. If I do echo " and Linux" >> file will be added to a new line. But I want last line as Unix and Linux So, in order…
Pandya
  • 24,618
113
votes
3 answers

Why is there a big delay after entering a wrong password?

I notice a weird (well, according to me) thing about passwords. For example, if I type an incorrect password during login, there will be a few seconds' delay before the system tells me so. When I try to sudo with a wrong password I would also have…
phunehehe
  • 20,240
113
votes
6 answers

List of available services

Is there any command that would show all the available services in my wheezy Debian based OS? I know that in order to see all the running services you can use service --status-all.
112
votes
1 answer

How to change cron shell (sh to bash)?

Is it possible to make commands in crontab run with bash instead of sh? I know you can pass commands to bash with -c, but that's annoying and I never use sh anyway.
Fluffy
  • 2,077
112
votes
5 answers

Possible missing firmware /lib/firmware/i915/* for module i915

I am getting these warnings every time I update my initramfs image(-s) with update-initramfs on my Dell PowerEdge T20 server running GNU/Linux Debian Buster 10.0. Is there a fix? W: Possible missing firmware /lib/firmware/i915/bxt_dmc_ver1_07.bin…
112
votes
2 answers

What are the differences between interactive, non-interactive, login, and non-login shells?

Possible Duplicate: Difference between Login Shell and Non-Login Shell? I have been looking at /etc/profile and /etc/bash.bashrc to see how they are run, and notice that some are executed by non-login shells, some work with interactive shells,…
vfclists
  • 7,531
  • 14
  • 53
  • 79
112
votes
7 answers

Show the year while listing files in the current directory

I am working on a Red Hat server. The commands ls -l or ll giving me the date and time in format +"%b %-d %H:%M". I want to list the files in a way where the year when each was file created would appear within the date. How is that possible?
WAEL
  • 1,579