Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Dec 312009
 

How to adjust the argument position in xargs?

Answer:

Sometimes you might want to adjust the argument position when using the xargs command, e.g.

echo "foo" | xargs echo "bar"

It gives:

bar foo

Instead, you want the piped argument "foo" to be inserted before the "bar", you can use

echo "foo" | xargs -i echo {} "bar"

Now it gives:

foo bar

That's very handy

Dec 312009
 

How to restart a frozen Linux System?

Answer:

Try the following two simple methods first:

  1. Hold down Ctrl+Alt+Backspace if you are in graphic mode
  2. if not work, then hold down "Ctrl+Alt+F1" to get into the shell and use the "reboot" command to reboot

If still not work, do the following:

  1. Hold down the Alt and SysRq (Print Screen) keys
  2. While holding those down, type the following in order: REISUB
  3. You computer will reboot now
Dec 192009
 

How to turn off SELinux?

Answer: (pick either one)

1. Change the run-time configuration (won't take effect when you reboot)

# sestatus informs you of the two permission mode statuses,
# the current mode in runtime and the mode from the config
# file referenced during boot:

sestatus | grep -i mode
Current mode: enforcing
Mode from config file: enforcing

# Changing the runtime enforcement doesn't effect the
# boot time configuration:

setenforce 1
sestatus | grep -i mode
Current mode: permissive
Mode from config file: enforcing

2. Turn off SELinux permanently, use the following command

system-config-securitylevel

Source: http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/selinux-guide/rhlcommon-section-0068.html