Results 1 to 4 of 4

Thread: Question about -F Linux Command

  1. #1
    Join Date
    Jan 2011
    Posts
    34

    Question about -F Linux Command

    I wonder that for what purpose this command might be used. Actually I have helped someone on one forum where user have asked one question about the following command. Here I have provided the command as follow which is for shutting down the machine there is something more then that which I don't understand.

    Code:
        sudo shutdown -r -F now
    what is the -F switch for and how will it effect shutting down process?

  2. #2
    Join Date
    May 2008
    Posts
    962

    Re: Question about -F Linux Command

    I know about this command which is good to use in conjunction with the shutdown command on your linux machine. Actually sudo shutdown -r command is to reboot your machine and -F is used for the file system check that is fsck. So the whole command that you are asking about is to reboot your machine and -F forces to check that file system when your machine boots up.

  3. #3
    Join Date
    Jan 2011
    Posts
    35

    Re: Question about -F Linux Command

    I'm looking for a way to stop my computer after a countdown of 10 seconds with the aid of a script does not require a password and can cancel the order if it is started again. I want it when I run the script, a countdown dema. st and at the end of the Coptic down, the computer stops. cepandant, if I run the script during comprising a timer, the script runs a 2nd killall <scripte>. Can you help me?

  4. #4
    Join Date
    May 2008
    Posts
    1,020

    Re: Question about -F Linux Command

    The shutdown command works fine but cannot give a number of seconds before stopping: it is at least minutes. Regarding the password, shutdown the computer is an operation that only root can do (you can stop as normal user in gnome because gdm is run as root and if you log in normally then console you do a startx you cannot turn off the computer). It will therefore precede the command with sudo, but you can edit the file / etc / sudoers (with sudo visudo-f / etc / sudoers) to be able to run shutdown with no password. It will add two lines like this:
    Code:
    # Cmnd alias specification Cmnd_Alias ETEINDRE=/sbin/shutdown, /sbin/init, /sbin/halt, /sbin/poweroff # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL, NOPASSWD:ETEINDRE
    Finally, if you want to do a script, here are some ideas: Launch the script, it checks if the file / tmp / foo exists. If NOT -> we created and we put the pid into the process. If YES -> the script has already been launched and should be read to kill the process whose pid is in the file. For the countdown, you can do:
    Code:
     i=0 while [ $i -lt $sec ] do sleep 1s echo Extinction dans $(( $sec - $i)) secondes done
    edit: I find easier than the pid:
    • If the file / tmp / foo does not exist it is created
    • If it exists it is destroyed
    • Before starting shutdown, if the file / tmp / foo shutdown is when you throw and if we do not start shutdown.

Similar Threads

  1. Linux history command and fc command
    By Alkesh jain in forum Operating Systems
    Replies: 3
    Last Post: 26-05-2009, 07:53 PM
  2. command line option in robocopy question
    By Viensterrr in forum Software Development
    Replies: 3
    Last Post: 22-05-2009, 02:32 PM
  3. Replies: 3
    Last Post: 18-05-2009, 08:38 AM
  4. Ubuntu Linux Question
    By Urjita in forum Operating Systems
    Replies: 3
    Last Post: 30-03-2009, 09:29 PM
  5. Registry Question: Broken Open Command?
    By aileen in forum MediaCenter
    Replies: 2
    Last Post: 25-09-2008, 12:19 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,727,011.99943 seconds with 17 queries