192k views
4 votes
There is a file "IT4983" in my home (personal) directory. I don’t know my current working directory. How can I find out the file type of "IT4983" (e.g. a text file, a link, or a directory?) without knowing my current working directory? ________ (file ~/IT4983, ls ~/IT4983 -l) Use one command only.

2 Answers

0 votes

Final answer:

To determine the file type of "IT4983" in the home directory, use the command 'file ~/IT4983'. It outputs information about whether the file is a text, binary, directory or a link.

Step-by-step explanation:

To find out the file type of "IT4983" located in your home directory without knowing your current working directory, you can use the following command:

file ~/IT4983

This command will output information about the file type, such as whether "IT4983" is a text file, a binary file, a directory, or a symbolic link, etc. The tilde (~) is a shorthand for your home directory, and this means the command will work regardless of your current working directory.

User Juanjo Martinez
by
5.4k points
5 votes

Answer and Explanation:

Find / -name "IT4983"

See what it will do is it will find the file named IT4983 in the root directory.

run this commmand with sudo just in case for permission issues.

then it will give you the location of that file we want to find.

Or

$ file /home/IT4983 ( you can type this command from whichever directory you are )

output : IT4983 , ASCII TEXT

User Overslacked
by
5.5k points