What does -f mean in bash

0 votes

I was looking at how to use runit to run gunicorn. I was looking at the bash file and I don't know what -f $PID does in

#!/bin/sh

GUNICORN=/usr/local/bin/gunicorn
ROOT=/path/to/project
PID=/var/run/gunicorn.pid

APP=main:application

if [ -f $PID ]; then rm $PID; fi

cd $ROOT
exec $GUNICORN -c $ROOT/gunicorn.conf.py --pid=$PID $APP

Google is useless in this case because searching for flags is useless

Jun 9, 2022 in Linux Administration by Rahul
• 3,380 points
738 views

1 answer to this question.

0 votes
Luckily, the Bash Reference Manual is accessible on the web. It's the principal hit when you Google for "Slam manual". §6.4 "Slam Conditional Expressions" says:

-f document

Valid on the off chance that document exists and is an ordinary record.
answered Jun 10, 2022 by Korak
• 5,820 points

Related Questions In Linux Administration

0 votes
1 answer

What does '-gt' operator mean in Bash programming?

It's a math test. assist with testing ...READ MORE

answered Jun 20, 2022 in Linux Administration by Rahul
• 3,380 points
1,046 views
0 votes
0 answers

What does the $ mean in Linux?

I have to explain what the code ...READ MORE

Apr 13, 2022 in Linux Administration by Soham
• 9,710 points
800 views
0 votes
0 answers

What does the $ mean in Linux?

I have to explain what the code ...READ MORE

Dec 14, 2022 in Linux Administration by erzan
• 630 points
791 views
+2 votes
2 answers

What does file permission 755 mean?

Hi, File permission 755 means that the directory ...READ MORE

answered Dec 9, 2020 in Linux Administration by MD
• 95,460 points
273,249 views
0 votes
0 answers

What exactly does the Unix `bash` command do when run without options?

When you type bash into the terminal ...READ MORE

Apr 14, 2022 in Linux Administration by Soham
• 9,710 points
440 views
0 votes
0 answers

What does "&" at the end of a linux command mean?

I am a system administrator and I ...READ MORE

Apr 21, 2022 in Linux Administration by Edureka
• 13,690 points
595 views
0 votes
1 answer

What does “sudo echo nameserver 8.8.8.8 > /etc/resolv.conf” do?

If executing this command resolved your issue ...READ MORE

answered Jan 23, 2019 in Linux Administration by joey
3,218 views
0 votes
1 answer

How to take input from user in bash script?

You can use if-else branch to check ...READ MORE

answered Jan 31, 2019 in Linux Administration by Omkar
• 69,220 points
1,153 views
0 votes
1 answer

How to check if a string contains a substring in Bash?

You ought to recollect that shell prearranging ...READ MORE

answered May 27, 2022 in Linux Administration by Korak
• 5,820 points
1,234 views
0 votes
1 answer

Is there a limit on the number of words in bash command 'for file in words'?

Anyway, you need to print everything except ...READ MORE

answered May 27, 2022 in Linux Administration by Korak
• 5,820 points
661 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP