About 388,000 results
Open links in new tab
  1. shell - What is the Bash file extension? - Stack Overflow

    Jan 19, 2019 · MS Windows generally uses a file's extension to determine how to open/execute it. Binary executables need to have a .exe extension. If you have a UNIX-like shell installed under Windows, you can configure Windows to recognize a .sh extension as a shell script, and use the shell to open it; Windows doesn't have the #! convention.

  2. How to check the extension of a filename in a bash script?

    Jan 2, 2009 · How to get extension of a file in shell script. 3. script for getting extensions of a file. 3.

  3. Change extension of file using shell script - Stack Overflow

    Mar 6, 2012 · How to change extension of all *.dat files in a directory to *.txt. Shell script should take the directory name as an argument. Can take multiple directories as arguments. Print the log of command

  4. linux - Add file extension to files with bash - Stack Overflow

    find . -type f -not -name "*.*" -print0 |\ xargs -0 file |\ grep 'JPEG image data' |\ sed 's/:.*//' |\ xargs -I % echo mv % %.jpg Breakdown: find all files without extension; check the file type; filter out only JPG files; delete filetype info; xargs run the "mv" for each file; the above command is for dry run, after it you should remove the ...

  5. linux - What's a .sh file? - Stack Overflow

    What is a file with extension .sh? It is a Bourne shell script. They are used in many variations of UNIX-like operating systems. They have no "language" and are interpreted by your shell (interpreter of terminal commands) or if the first line is in the form #!/path/to/interpreter they will use that particular interpreter. Your file has the ...

  6. How can I remove the extension of a filename in a shell script?

    If you have a filepath and not just a filename, you'll want to use basename first to get just the filename including the extension. Otherwise, if there's a dot only in the path (e.g. path.to/myfile or ./myfile ), then it will trim inside the path; even if there isn't a dot in the path, it will get the (e.g. path/to/myfile if the path is path/to ...

  7. Extract filename and extension in Bash - Stack Overflow

    Jun 8, 2009 · The question is problematic in the first place because.. From the perspective of the OS and unix file-systems in general, there is no such thing as a file extension.

  8. How to get extension of a file in shell script - Stack Overflow

    Mar 1, 2010 · How to change file extension in Linux shell script? 1. Bash - extract file name and extension from a ...

  9. Extract file basename without path and extension in bash

    Apr 19, 2010 · Closer @tripleee: this is not a duplicate of Extract filename and extension in Bash. The other more complex Q requires the extension and filename be separate. If anything, the other Q. is an elaboration of this more basic one. –

  10. Recursively look for files with a specific extension

    The line with cut gets you only the middle part of front.middle.extension. You should read up your shell manual on ${varname%%pattern} and friends. I assume you do this as an exercise in shell scripting, otherwise the find solution already proposed is the way to go. To check for proper shell syntax, without running a script, use sh -n scriptname.

Refresh